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
function solution(N) { | |
// sorry, not really my kind of thing, but here’s a goat: | |
console.log("\n\ | |
\n\ | |
/) (\\ \n\ | |
)\\.:::::::::./( \n\ | |
\\( o o )/ \n\ | |
'-./ / _.-'`-. \n\ | |
( oo ) / _ \\ \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
#!/usr/bin/env bash | |
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x | |
APP="$1"; IMAGE="dokku/$APP" | |
CRONTABS_DIR=$DOKKU_ROOT/.crontab | |
CONFIG_FILE=$CRONTABS_DIR/$APP.conf | |
mkdir -p "$CRONTABS_DIR"; |
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 QueryDependent | |
{ | |
/** | |
* @var Callable | |
*/ | |
private $queryFactory; |
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 | |
namespace Metricso\Fetcher\ObjectProcessor ; | |
use Generator ; | |
use Metricso\Model\Fb\AppUser ; | |
use Metricso\Model\Fb\FbPage ; | |
use Metricso\Model\Fb\FbPageFeedQuery ; | |
class PageProcessor extends AbstractObjectProcessor implements ObjectProcessorInterface, UsingAlternateTokensInterface { | |
private $queryFactory ; | |
private $tokenSource ; |
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 | |
$retry = [ | |
"today" => 'failure-notification', | |
'+1 day' => 'none', | |
'+3 days' => 'failure-notification', | |
'+1 week' => 'failure-notification', | |
'+2 weeks' => 'failure-notification, suspend' | |
]; | |
?> |
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 | |
interface EmailNotifierInterface { | |
/** | |
* Client was successfully charged for a project | |
* | |
* context: payment_history model (with access to project & invoice) | |
*/ | |
const NOTIFICATION_CHARGED = 'charged'; | |
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 PaymentsFacade extends Container | |
{ | |
private $requiredKeys = [ | |
'factory.project', | |
'price-calculator', | |
'repository.plan', | |
'repository.coupon', | |
'service.authorize-card', |
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
# You don't need Fog in Ruby or some other library to upload to S3 -- shell works perfectly fine | |
# This is how I upload my new Sol Trader builds (http://soltrader.net) | |
# Based on a modified script from here: http://tmont.com/blargh/2014/1/uploading-to-s3-in-bash | |
S3KEY="my aws key" | |
S3SECRET="my aws secret" # pass these in | |
function putS3 | |
{ | |
path=$1 |
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 | |
// Node[] -> (map) -> NodeTranslation[] -> (map) -> Category[] -> slice | |
// Purely „functional” PHP: | |
$parents = array_slice(array_map(function (NodeTranslation $nt) | |
{ | |
return new Category($nt->getTitle(), $nt->getNode()->getId(), $nt->getSlug()); | |
}, array_map(function (Node $node) | |
{ |
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
/** | |
* The first commented line is your dabblet’s title | |
*/ | |
* { | |
border: 1px dashed silver; width: 100px; height: 100px; | |
background: #f06; | |
background: linear-gradient(45deg, #f06, yellow); | |
min-height:100%; | |
} |