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
#!/bin/sh | |
WP_CONTENT="path to the wp-content directory of your install" | |
LANG_DIR=$WP_CONTENT/languages | |
TMP=$LANG_DIR/tmp | |
mkdir -p $TMP | |
/usr/bin/curl -s -o $TMP/bg_BG.po 'http://translate.wordpress.org/projects/wp/dev/bg/default/export-translations?format=po' | |
/usr/bin/curl -s -o $TMP/bg_BG.mo 'http://translate.wordpress.org/projects/wp/dev/bg/default/export-translations?format=mo' |
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 | |
add_filter( 'import_original_array', function( $args ) { | |
if ( isset( $args['references'] ) && preg_match( '|wp-content/themes/premium|', $args['references'] ) ) { | |
$args['priority'] = 'hidden'; | |
} | |
return $args; | |
} ); |
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
#!/bin/sh | |
LANG_DIR=/var/www/nb/nikolay.bg/bgbg/wp-content/languages | |
D=$LANG_DIR/tmp | |
/usr/bin/curl -s -o $D/bg_BG.po 'http://translate.wordpress.org/projects/wp/dev/bg/default/export-translations?format=po' | |
/usr/bin/curl -s -o $D/bg_BG.mo 'http://translate.wordpress.org/projects/wp/dev/bg/default/export-translations?format=mo' | |
/usr/bin/curl -s -o $D/admin-bg_BG.po 'http://translate.wordpress.org/projects/wp/dev/admin/bg/default/export-translations?format=po' | |
/usr/bin/curl -s -o $D/admin-bg_BG.mo 'http://translate.wordpress.org/projects/wp/dev/admin/bg/default/export-translations?format=mo' |
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
pbpaste| base64 -D > x.pdf |
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
for i in `curl -s https://api.github.com/orgs/impromptu/repos | json -a name`; do hub clone Impromptu/$i; done |
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 | |
$pids = array(); | |
for($i=0; $i<10; ++$i) { | |
$pid = pcntl_fork(); | |
if ($pid) { | |
$pids[] = $pid; | |
} else { | |
sleep(2); | |
echo "Child " . posix_getpid() . " slept enough.\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
def twice(name, &blk) | |
yield 1, 2 | |
yield [1, 2] | |
blk.call(1, 2) | |
end | |
a, b = 1, 2 | |
10.times do | |
puts 'toshko' |
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
#include <unistd.h> | |
#include <stdlib.h> | |
#include <stdio.h> | |
#include <errno.h> | |
/* MB of memory to allocate */ | |
#define MB 100 | |
/* How many processes to spawn */ | |
#define FORKS 50 | |
/* How many random elements to change in the child process */ |
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
{ | |
"config" : { | |
"vendor-dir": "." | |
}, | |
"require": { | |
"phpunit/phpunit": "*", | |
"squizlabs/php_codesniffer": "*", | |
"nb/oxymel": "dev-master" | |
} | |
} |
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 | |
public function notify_project_owner( $post_id ) { | |
if( 'project' == get_post_type() ) { | |
if( 'publish' == get_post_status( $post_id ) ) { | |
if( 'true' != get_post_meta( $post_id, 'project_owner_emailed', true ) ) { | |
$this->mailer->set_subject( __( 'Your Project Has Been Published!', 'cj' ) ); | |
$this->mailer->set_message( __( 'Need filler text.', 'cj' ) ); | |
$this->mailer->send_mail( $this->temp_email ); |