put the function in your .zshrc or .bashrc and then
~ ia-save http://twitter.com/atomotic
https://web.archive.org/web/20140702123925/http://twitter.com/atomotic
<php | |
// Rewrite of "get_the_post_thumbnail" for compatibility with jQuery LazyLoad plugin | |
function my_get_the_post_lazyload_thumbnail( $post_id = false, $size = 'full' ) { | |
if ( $post_id ) { | |
// Get the id of the attachment | |
$attachment_id = get_post_thumbnail_id( $post_id ); | |
if ( $attachment_id ) { | |
$src = wp_get_attachment_image_src( $attachment_id, $size ); | |
if ($src) { | |
$img = get_the_post_thumbnail( $post_id, $size, array( |
function custom_curl_multi_exec($mh, &$running){ | |
do{ | |
$rv = curl_multi_exec($mh, $running); | |
} | |
while ($rv === CURLM_CALL_MULTI_PERFORM); |
/** | |
* Check if a given ip is in a network | |
* @param string $ip IP to check in IPV4 format eg. 127.0.0.1 | |
* @param string $range IP/CIDR netmask eg. 127.0.0.0/24, also 127.0.0.1 is accepted and /32 assumed | |
* @return boolean true if the ip is in this range / false if not. | |
*/ | |
function ip_in_range( $ip, $range ) { | |
if ( strpos( $range, '/' ) == false ) { | |
$range .= '/32'; | |
} |
put the function in your .zshrc or .bashrc and then
~ ia-save http://twitter.com/atomotic
https://web.archive.org/web/20140702123925/http://twitter.com/atomotic
bootbox.dialog({ | |
/** | |
* @required String|Element | |
*/ | |
message: "I am a custom dialog", | |
/** | |
* @optional String|Element | |
* adds a header to the dialog and places this text in an h4 | |
*/ |
##Handles
>
input[type="button"]:hover
##Example
$css_contents = file_get_contents($url);
function strip_single_tag($str,$tag=''){ | |
if(is_array($tag)){ | |
foreach($tag as $t){ | |
$str=strip_single_tag($str,$t); | |
} | |
} | |
else{ |
<?php | |
if (!isset($_SESSION['user'])) { | |
require_once( COMPONENTS . "/user/class.user.php" ); | |
$_SESSION['user'] = $_SERVER['PHP_AUTH_USER']; | |
$_SESSION['lang'] = 'en'; | |
$_SESSION['theme'] = 'default'; | |
$_SESSION['project'] = '/var/www'; | |
$User = new User(); |
token_get_all()
and token_name()
wrape_function_name
to control the behavoregetcwd()
to store the current directory and chdir()
to reset it to the original location so the static resources will be dowloaded from the originechdir()
to restore the previous directory location