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 | |
class Test_Did_Action extends WP_UnitTestCase { | |
public function test_did_action_should_be_two_if_action_fired_twice() { | |
do_action( 'wink' ); | |
do_action( 'wink' ); | |
$this->assertEquals( 2, did_action( 'wink' ) ); | |
} | |
public function test_did_action_should_be_one_if_action_fired_once() { |
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
<style> | |
#big { | |
font-size: 25vw; | |
font-family: 'Helvetica Neue', sans-serif; | |
font-weight: bold; | |
} | |
#big:-webkit-full-screen { | |
width: 100%; | |
height: 100%; | |
margin: auto; |
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
добрев | |
дробове | |
брадва | |
добрева | |
дъбрава | |
дърводобив | |
брадви | |
бърдаров | |
бодуров | |
бордови |
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
0 11 * * * /usr/local/bin/brew list > /Users/nb/backup/brew.list | |
0 11 * * * /usr/bin/crontab -l > /Users/nb/backup/crontab | |
0 11 * * * /bin/cp /Users/nb/lib/php/composer.json /Users/nb/backup/ | |
0 11 * * * /bin/ls /Applications > /Users/nb/backup/apps.list |
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 = ''; |
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
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
# 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
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
### 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: |
NewerOlder