Skip to content

Instantly share code, notes, and snippets.

View Sahariar's full-sized avatar
🏠
Working from home

Sahariar Kabir Sahariar

🏠
Working from home
View GitHub Profile
<?php
#!/usr/bin/env php
foreach(glob("*.css") as $css){
echo "wp_enqueue_style( 'wptheme-{$css}', get_template_directory_uri().'/css/{$css}',null,'1.0');\n";
}
@Sahariar
Sahariar / enq-js.php
Last active August 29, 2015 14:09 — forked from hasinhayder/enq-js.php
<?php
#!/usr/bin/env php
foreach(glob("*.js") as $js){
echo "wp_enqueue_script( 'wptheme-{$js}', get_template_directory_uri().'/js/{$js}', array('jquery'),'1.0',true);\n";
}
@hasinhayder
hasinhayder / enq-css.php
Last active February 21, 2021 07:08
generate wp_enqueue_style calls for all the css files in current directory
#!/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";
}
<?php
#!/usr/bin/env php
//usage: php envato-screenshots-downloader.php /path/to/save/screenshots http://url/to/screenshots/page
set_time_limit(0);
$dir = $argv[1];
$source = $argv[2];
print_r($argv);
mkdir ($dir);
$src = file_get_contents($source);
$pattern = '/src="(https:\/\/0.s3[a-zA-Z0-9_\-\.\/%]+)"/i';