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
#!/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
<?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 | |
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
### Keybase proof | |
I hereby claim: | |
* I am nb on github. | |
* I am nikolayb (https://keybase.io/nikolayb) on keybase. | |
* I have a public key whose fingerprint is 5B90 5510 BE15 69CB 2D45 146F 9452 16AC 9610 D078 | |
To claim this, I am signing this object: |
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
it( 'should handle series of same component', function() { | |
var expectedResultString = '<span><a href="#">baba</a><a href="#">dyado</a></span>', | |
translatedComponent = translate( '{{link}}baba{{/link}}{{link}}dyado{{/link}}', { components: { link: link } } ); | |
assert.equal( expectedResultString, stripReactAttributes( React.renderToString( translatedComponent ) ) ); | |
} ); | |
it( 'should handle wrong cross-nesting', function() { | |
var expectedResultString = '', // how do we return error? | |
translatedComponent = translate( '{{link}}a{{em}}b{{/link}}c{{/em}}', { components: { link: link, em: em } } ); | |
assert.equal( expectedResultString, stripReactAttributes( React.renderToString( translatedComponent ) ) ); |
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
# look for the ID of the `default` VM | |
vagrant global-status | |
vagrant ssh <default-id> | |
# install nsenter | |
docker run -v /usr/local/bin:/target jpetazzo/nsenter | |
# get the container id, not the image id | |
docker ps |
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
import unittest | |
def is_interval(interval, **kwargs): | |
to_list = lambda value: [value] if isinstance(value, basestring) else value | |
list_from_kwarg = lambda key: to_list(kwargs.get(key, [])) | |
units = ['y', 'm', 'd', 'h', 'i', 's'] | |
only = list_from_kwarg('only') | |
if only: | |
return is_interval(interval, with_ = only, without = list(set(units) - set(only))) | |
with_ = list_from_kwarg('with_') |
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
// to run place your solution in index.js and run: babel-node --stage 0 test.js | |
import assert from 'assert'; | |
import toTitleCase from './index'; | |
const tests = [ | |
{ | |
"input": "follow step-by-step instructions", | |
"expect": "Follow Step-by-Step Instructions" | |
}, | |
{ | |
"input": "this sub-phrase is nice", |
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 | |
/** | |
* Retrieve category, tag, or term description. | |
* | |
* @since 4.1.0 | |
* | |
* @return string Archive description. | |
*/ | |
function get_the_archive_description() { | |
$description = ''; |