filter { throttle { before_count => 30 period => 60 add_tag => "chill-out" } }
output { if "chill-out" not in [tags] {
| (function (global){ | |
| "use strict"; | |
| var fabric=global.fabric||(global.fabric={}), | |
| extend=fabric.util.object.extend, | |
| clone=fabric.util.object.clone; | |
| if(fabric.CurvedText){ | |
| fabric.warn('fabric.CurvedText is already defined'); |
| <?php | |
| \Blade::directive('var', function($expression) { | |
| $segments = array_map(function($segment) { | |
| return trim($segment); | |
| }, explode(',', preg_replace("/[\(\)\\\"\']/", '', $expression))); | |
| return '<?php $' . $segments[0] . " = '" . $segments[1] . "' ?>"; | |
| }); |
| <?php | |
| function autoLink($str, $attributes=array()) { | |
| $attrs = ''; | |
| foreach ($attributes as $attribute => $value) { | |
| $attrs .= " {$attribute}=\"{$value}\""; | |
| } | |
| $str = ' ' . $str; | |
| $str = preg_replace( | |
| '`([^"=\'>])((http|https|ftp)://[^\s<]+[^\s<\.)])`i', | |
| '$1<a href="$2"'.$attrs.'>$2</a>', |
filter { throttle { before_count => 30 period => 60 add_tag => "chill-out" } }
output { if "chill-out" not in [tags] {
I hereby claim:
To claim this, I am signing this object:
| #301 Redirects for .htaccess | |
| #Redirect a single page: | |
| Redirect 301 /pagename.php http://www.domain.com/pagename.html | |
| #Redirect an entire site: | |
| Redirect 301 / http://www.domain.com/ | |
| #Redirect an entire site to a sub folder | |
| Redirect 301 / http://www.domain.com/subfolder/ |
| #!/usr/bin/env php | |
| <?php | |
| echo "Running tests... "; | |
| exec('vendor/bin/phpunit', $output, $returnCode); | |
| if ($returnCode !== 0) { | |
| // Show full output | |
| echo PHP_EOL . implode($output, PHP_EOL) . PHP_EOL; | |
| echo "Cannot push changes untill all tests pass." . PHP_EOL; | |
| exit(1); | |
| } |
| #!/usr/bin/env php | |
| <?php | |
| echo "Running tests... "; | |
| exec('vendor/bin/phpunit', $output, $returnCode); | |
| if ($returnCode !== 0) { | |
| // Show full output | |
| echo PHP_EOL . implode($output, PHP_EOL) . PHP_EOL; | |
| echo "Cannot commit changes untill all tests pass." . PHP_EOL; | |
| exit(1); | |
| } |
| <?php | |
| # | |
| # github.com/nathane | |
| # @natedrug | |
| # | |
| function encryptTextForHuman($text=null){ | |
| try { | |
| if(is_null($text) || empty($text)) throw new Exception("Error: expected 'text' argument is missing, empty or null."); | |
| return implode(' ', array_map(function($word){ |
| <?php | |
| Request::macro('match', function ($candidates, $default = null) { | |
| $candidates = collect($candidates); | |
| $type = collect(request()->getAcceptableContentTypes())->map(function ($type) { | |
| return $this->getFormat($type); | |
| })->first(function ($type) use ($candidates) { | |
| return $candidates->keys()->contains($type); | |
| }); | |
| $match = $candidates->get($type, $default ?? $candidates->first()); | |
| return value($match); |