I hereby claim:
- I am hasinhayder on github.
- I am hasin (https://keybase.io/hasin) on keybase.
- I have a public key whose fingerprint is 8319 D4D0 29CE 3C50 F788 D033 95EB 88C0 DF4D 79A3
To claim this, I am signing this object:
<?php | |
//file: fetch.php | |
use Twig_Extension; | |
use Twig_Function_Method; | |
class Fetch extends Twig_Extension | |
{ | |
public function fetch ($url, $params=array()) | |
{ | |
if($url){ | |
$ch = curl_init($url); |
I hereby claim:
To claim this, I am signing this object:
<?php | |
function change_to_cdn_url() { | |
return 'http://your.cdn.url/wp-content/uploads'; | |
} | |
add_filter( 'pre_option_upload_url_path', 'change_to_cdn_url' ); |
for(i=0;i<selected_ids.length;i++){ | |
if(selected_ids[i]>0){ | |
var attachment = new wp.media.model.Attachment.get(selected_ids[i]); | |
attachment.fetch({success:function(att){ | |
container.append("<li><img src='" + att.attributes.sizes.thumbnail.url + "'</li>"); | |
}}); | |
} | |
} |
<?php | |
function tb_get_previous_post_link(){ | |
global $post; | |
$prev_link = ""; | |
$prev_post = get_previous_post(); | |
if($prev_post){ | |
$prev_link = get_the_permalink($prev_post->ID); | |
} | |
return $prev_link; | |
} |
def main(): | |
print max([2,3,4,5,1,2,11,2,8,3,10]) | |
def max(nums): | |
_max=nums[0] | |
for n in nums: | |
_max = _max if (_max>n) else n | |
return _max | |
if __name__ == "__main__": main() |
var counter = function(arg){ | |
var local; | |
function incr(arg2){ | |
arg2 = arg2 == undefined ? 1 : arg2; | |
return !local ? (local = arg2, incr) : (local += arg2, local); | |
} | |
return incr(arg); | |
} | |
var cnt = counter(5); |
var counter = function(arg){ | |
arg = arg == undefined ? 1 : arg; | |
var me = arguments.callee; | |
return me.count ? ( me.count += arg, me.count ) : ( me.count = arg, me ); | |
} | |
var cnt = counter(5); | |
cnt(); | |
cnt(); | |
console.log(cnt(5)); //shud return 12 |
var me = { | |
_first:"Count", | |
_last: "Dracula"; | |
} | |
me.__defineGetter__('first', function() { return this._first; }); | |
me.__defineGetter__('last', function() { return this._last; }); | |
me.first= "Die!"; | |
console.log(me.first); //still shows "Count" |
function number_of_posts_per_day($query){ | |
if (date("l")=="Sunday") { | |
$query->set('posts_per_page', 20); | |
} | |
elseif (date("l")=="Monday") { | |
$query->set('posts_per_page', 10); | |
} | |
elseif (date("l")=="Tuesday") { | |
$query->set('posts_per_page', 5); | |
} |