This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env php | |
<?php | |
foreach(glob("*.css") as $css){ | |
echo "wp_enqueue_style( 'wptheme-{$css}', get_template_directory_uri().'/css/{$css}',null,'1.0');\n"; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env php | |
<?php | |
foreach(glob("*.js") as $js){ | |
echo "wp_enqueue_script( 'wptheme-{$js}', get_template_directory_uri().'/js/{$js}', array('jquery'),'1.0',true);\n"; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* add a listener to display all the queries being executed in laravel */ | |
DB::listen( function ( $query ) { | |
var_dump( $query->sql ); | |
} ); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* A helper file for Laravel 5, to provide autocomplete information to your IDE | |
* Generated for Laravel 5.1.31 (LTS) on 2016-03-01. | |
* | |
* @author Barry vd. Heuvel <[email protected]> | |
* @see https://github.com/barryvdh/laravel-ide-helper | |
*/ | |
namespace { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[ | |
{ "keys": ["super+shift+f"], "command": "reindent" , "args": {"single_line": false}}, | |
{ "keys": ["super+d"], "command": "duplicate_line" }, | |
{ "keys": ["super+v"], "command": "paste_and_indent" }, | |
{ "keys": ["super+shift+v"], "command": "paste" }, | |
{ "keys": ["ctrl+n"], "command": "advanced_new_file" }, | |
{ "keys": ["super+l"], "command": "show_overlay", "args": {"overlay": "goto", "text": ":"} }, | |
] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
file_put_contents( 'progress.txt', '' ); | |
$targetFile = fopen( 'testfile.iso', 'w' ); | |
$ch = curl_init( 'http://ftp.free.org/mirrors/releases.ubuntu-fr.org/11.04/ubuntu-11.04-desktop-i386-fr.iso' ); | |
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); | |
curl_setopt( $ch, CURLOPT_NOPROGRESS, false ); | |
curl_setopt( $ch, CURLOPT_PROGRESSFUNCTION, 'progressCallback' ); | |
curl_setopt( $ch, CURLOPT_FILE, $targetFile ); |