This file contains 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 | |
function init_url_rewrite_rule(){ | |
add_rewrite_endpoint( 'edit',EP_PERMALINK | EP_PAGES | EP_ATTACHMENT ); | |
if(get_option("EDIT_REWRITE_RULE")!=1){ | |
flush_rewrite_rules(); | |
update_option("EDIT_REWRITE_RULE",1); | |
} | |
} | |
function redirect_edit_url(){ |
This file contains 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 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 <barryvdh@gmail.com> | |
* @see https://github.com/barryvdh/laravel-ide-helper | |
*/ | |
namespace { |
This file contains 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 ); |
This file contains 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
sudo chown -R $(whoami) /usr/local |
This file contains 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
// migrate the script executer's primary domain | |
// domainName - the desired domain to migrate to | |
function migrateDomain(organizationName, domainName) { | |
var customerId = 'my_customer'; | |
var customer = AdminDirectory.Customers.get(customerId); | |
customer.customerDomain = domainName; | |
customer.postalAddress.organizationName = organizationName; | |
customer.customerCreationTime = undefined; // | |
AdminDirectory.Customers.patch(customer, customerId); | |
This file contains 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 | |
/* Keep your images in a folder named 'img' in the same folder where this script resides*/ | |
/* Run the command "php imagereplace.php */ | |
/* ImageMagick PHP extension is required */ | |
function getDirContents($dir, &$results = array()) { | |
$files = scandir($dir); | |
foreach ($files as $key => $value) { | |
$path = realpath($dir . DIRECTORY_SEPARATOR . $value); |
This file contains 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
mount -o remount,size=5G,noatime /tmp | |
Also the following line in /etc/fstab helps | |
none /tmp tmpfs defaults,size=5000000000 0 0 | |
But make sure that /etc/default/rcS | |
RAMTMP=no | |
Also in /etc/defaults/tmpfs |
This file contains 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
diskutil erasedisk hfs+ External GPT /dev/disk2 |
This file contains 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
ServerAliveInterval 10 | |
TCPKeepAlive yes |