Check whether an array is empty

function in_multi_dimensional_array($multidimarray, $multidimarray_key, $lookingfor ) {
 $found = false;
 foreach ($multidimarray as $key => $data) {
  if ($data[$multidimarray_key] == $lookingfor) {
   // item found => add new keys & data if (!empty($multidimarray_newdata))
   $found = true;
   break; // no need to loop anymore, as we have found the item => exit the loop
  }
 }
 return $found;
}

function in_multi_dimensional_modifiable_array($multidimarray, $multidimarray_key, $lookingfor, $multidimarray_newdata = array() ) {
 $found = false;
 foreach ($multidimarray as $key => $data) {
  if ($data[$multidimarray_key] == $lookingfor) {
   // item found => add new keys & data if (!empty($multidimarray_newdata))
   foreach($multidimarray_newdata as $key => $value) {
    $data[$key] = $value;
   }
   $found = true;
   break; // no need to loop anymore, as we have found the item => exit the loop
  }
 }
 return $found;

// if ($found === false) {
 // The id you were looking for has not been found,
 // which means the corresponding item is not already present in your array
 // => Add a new item to the array
// }
}

Source: Check whether an array is empty

Can I get a list of files marked –assume-unchanged?

What have I marked as –assume-unchanged? Is there any way to find out what I’ve tucked away using that option? I’ve dug through the .git/ directory and don’t see anything that looks like what I’d

Source: Can I get a list of files marked –assume-unchanged?

This is a great way to hide changes to files (e.g., db config files):

git config --global alias.hidden '!git ls-files -v | grep "^[a-z]"'

Here’s a complete selection of nice additions:

git config --global alias.hide '!git update-index --assume-unchanged'
git config --global alias.unhide '!git update-index --no-assume-unchanged'
git config --global alias.unhide-all '!git update-index --really-refresh'
git config --global alias.hidden '!git ls-files -v | grep "^[a-z]"'
git config --global alias.ignored '!git !git status -s --ignored | grep \"^!!\"'' 

Nifty!

crontab.guru – the cron schedule expression editor

An easy to use editor for crontab schedules.

Source: crontab.guru – the cron schedule expression editor

1 8 4 * *
“At 08:01 on the 4th of every month.”
next at 2016-09-04 08:01
random

[minute] [hour] [date] [month] [weekday]

* any value
, value list separator
range of values
/ step values
@yearly (non-standard)
@annually (non-standard)
@monthly (non-standard)
@weekly (non-standard)
@daily (non-standard)
@hourly (non-standard)

More info here:

https://en.wikipedia.org/wiki/Cron

Cost to charge an iPhone for a year?

[et_pb_section admin_label=”section”][et_pb_row admin_label=”row”][et_pb_column type=”4_4″][et_pb_text admin_label=”Text” background_layout=”light” text_orientation=”left” use_border_color=”off” border_color=”#ffffff” border_style=”solid”]

Ever thought how much your iPhone (or Android smartphone) is costing you in power a year to charge? What about your tablet or laptop? Or your ebook reader? And do wall warts consume power when there’s nothing connected to them?

Source: How much does it cost to charge an iPhone for a year? | ZDNet

 


Cost per year at $0.12 / kWh

[/et_pb_text][et_pb_pricing_tables admin_label=”Pricing Tables” show_bullet=”on” center_list_items=”off” use_border_color=”off” border_color=”#ffffff” border_style=”solid” custom_button=”off” button_letter_spacing=”0″ button_use_icon=”default” button_icon_placement=”right” button_on_hover=”on” button_letter_spacing_hover=”0″ remove_featured_drop_shadow=”off”] [et_pb_pricing_table featured=”off” title=”iPhone” currency=”$” sum=”0.84″ header_font_select=”default” header_font=”||||” subheader_font_select=”default” subheader_font=”||||” currency_frequency_font_select=”default” currency_frequency_font=”||||” price_font_select=”default” price_font=”||||” body_font_select=”default” body_font=”||||” custom_button=”off” button_font_select=”default” button_font=”||||” button_use_icon=”default” button_icon_placement=”right” button_on_hover=”on” subtitle=”iPhone 6 Plus”]

+ 19.2 Wh overnight charge

+ 7kWh / year

[/et_pb_pricing_table][et_pb_pricing_table featured=”off” title=”iPad” currency=”$” sum=”1.55″ header_font_select=”default” header_font=”||||” subheader_font_select=”default” subheader_font=”||||” currency_frequency_font_select=”default” currency_frequency_font=”||||” price_font_select=”default” price_font=”||||” body_font_select=”default” body_font=”||||” custom_button=”off” button_font_select=”default” button_font=”||||” button_use_icon=”default” button_icon_placement=”right” button_on_hover=”on” subtitle=”iPad Air 2″]

+ 35.3 Wh overnight charge

+ 12.9kWh / yr

[/et_pb_pricing_table][et_pb_pricing_table featured=”off” title=”MacBook Pro” subtitle=”15″ currency=”$” sum=”5.63″ header_font_select=”default” header_font=”||||” subheader_font_select=”default” subheader_font=”||||” currency_frequency_font_select=”default” currency_frequency_font=”||||” price_font_select=”default” price_font=”||||” body_font_select=”default” body_font=”||||” custom_button=”off” button_font_select=”default” button_font=”||||” button_use_icon=”default” button_icon_placement=”right” button_on_hover=”on”]

+ 128.5 Wh overnight charge

+ 46.9kWh / yr

[/et_pb_pricing_table][et_pb_pricing_table featured=”off” title=”Kindle” currency=”$” sum=”0.01″ header_font_select=”default” header_font=”||||” subheader_font_select=”default” subheader_font=”||||” currency_frequency_font_select=”default” currency_frequency_font=”||||” price_font_select=”default” price_font=”||||” body_font_select=”default” body_font=”||||” custom_button=”off” button_font_select=”default” button_font=”||||” button_use_icon=”default” button_icon_placement=”right” button_on_hover=”on” subtitle=”Paperwhite”]

+ 7.7 Wh overnight charge

+ 0.1kWh / year

[/et_pb_pricing_table] [/et_pb_pricing_tables][/et_pb_column][/et_pb_row][/et_pb_section]

MailTo Syntax

MailTo Syntax.

The MailTo command can do more than enter a single e-mail address in the “Send To” field while activating your e-mail program. It can also:

Feature Syntax
Address message to multiple recipients , (comma separating e-mail addresses)
Add entry in the “Subject” field subject=Subject Field Text
Add entry in the “Copy To” or “CC” field [email protected]
Add entry in the “Blind Copy To” or “BCC” field [email protected]
Add entry in the “Body” field body=Your message here
Within the body use “%0A” for a new line,
use “%0A%0A” for a new line preceded by a blank line (paragraph),
see example below.

Notes:

” “ (beginning and ending double quotes) are necessary if any spaces are used Mailto parameter should be preceded by “?” for the first or only parameter and “&” for second and subsequent parameter.

Some examples, with actual HTML Code included, follow:

Simple MailTo

Features may be used in combination

Remember to use only one ? (question mark), when providing multiple entries beyond e-mail address

IEBlog : Site Compatibility and IE8

IEBlog : Site Compatibility and IE8

Here’re a couple of methods for coding to IE8 (new hacks! d’oh!):

Initial CSS Property Values

Unset properties on the currentStyle object now return their initial value. Relying on the old initial values for CSS properties such as z-index can cause problems. This is the root cause of issues with the ASP.NET menu control. SOLUTION: Perform a check for both the backwards compatible value and the standardized initial value.
var zIndex = elm.currentStyle.zIndex;
if(zIndex == 0) {
// custom code
}
var zIndex = elm.currentStyle.zIndex;
if(zIndex == 0 || zIndex == “auto”) {
// custom code
}

Tutorials – Servers > Telnet as a Diagnostic Aid

I don’t know about you, but I can use a reefresher now and again for things like surfing with Telnet to determine if 301 re-directs work…

In a nutshell, you’ll want something like this:

telnet eastvalley.freedomblogging.com 80[cr]
Trying 69.25.233.100…
Connected to eastvalley.freedomblogging.com.
Escape character is ‘^]’.
HEAD / HTTP/1.1[cr]
Host: eastvalley.freedomblogging.com[cr]
[cr]

Note: italic items are sent by the server, whilst non-italic items are typed. Also NOTE the double carriage return ([cr]) at the end.

Tutorials – Servers > Telnet as a Diagnostic Aid

Hacking IE CSS: Underscore, Box Model ‘Voice Family’, & Star hacks

CSS Hacks

Underscore Hack

/* CSS hack for IE 6 and below */
.test {
  position: fixed;
  _position: absolute;
}

Voice Family (Box Family or Tantek Hack)

/* CSS hack for IE 5.x */
.test {
  width: 500px;
  padding: 50px;
  voice-family: ""}"";
  voice-family: inherit;
  width: 400px;
}
html>body .test{
 width: 400px;
}

Backslash Hack

/* CSS hack for IE 5.5 and below */

.test {
  height: 500px;
  height: 400px;
}

Commented Backslash Hack

/* begin hiding from IE5 Mac */
.test {
  color: red;
}
/* end */

And then there’s:

/* apply ONLY to IE5 Mac *//*/
.test {
  color: red;
}
/* end */

High Pass Filter

/* CSS hack hides from browser which don't support @import */
  @import "null.css?"{";
  @import "highpass.css";



	

Farbtastic: jQuery color picker plug-in | Steven Wittens – Acko.net

Farbtastic Color Picker widgetFarbtastic is a jQuery plug-in that can add one or more color picker widgets into a page through JavaScript. Each widget is then linked to an existing element (e.g. a text field) and will update the element’s value when a color is selected.

Download Farbtastic 1.2 – 8 January 2007 (License: GPL).

Farbtastic: jQuery color picker plug-in | Steven Wittens – Acko.net