Skip to content

Instantly share code, notes, and snippets.

View Ataurr's full-sized avatar
🎯
Focusing

AtaurR Ataurr

🎯
Focusing
View GitHub Profile
@Ataurr
Ataurr / functions.php
Created December 7, 2016 11:59 — forked from wpscholar/functions.php
Enqueueing IE conditional stylesheets in WordPress the right way
<?php
add_action( 'wp_enqueue_scripts', 'enqueue_my_styles' );
/**
* Example callback function that demonstrates how to properly enqueue conditional stylesheets in WordPress for IE.
* IE10 and up does not support conditional comments in standards mode.
*
* @uses wp_style_add_data() WordPress function to add the conditional data.
* @link https://developer.wordpress.org/reference/functions/wp_style_add_data/
@Ataurr
Ataurr / envato-screenshots-downloader.php
Created January 22, 2016 13:07 — forked from hasinhayder/envato-screenshots-downloader.php
Download large preview images from the envato item's screenshots page
#!/usr/bin/env php
<?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';
@Ataurr
Ataurr / enq-js.php
Last active August 29, 2015 14:09 — forked from hasinhayder/enq-js.php
#!/usr/bin/env php
<?php
foreach(glob("*.js") as $js){
echo "wp_enqueue_script( 'xs-{$js}', XS_SCRIPTS .'/{$js}', array('jquery'), XS_VERSION, true);\n";
}
@Ataurr
Ataurr / enq-css.php
Last active August 29, 2015 14:09 — forked from hasinhayder/enq-css.php
#!/usr/bin/env php
<?php
foreach(glob("*.css") as $css){
echo "wp_enqueue_style( 'xs-{$css}', XS_CSS .'/{$css}',null, XS_VERSION);\n";
}