This file contains hidden or 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 declare(strict_types=1); | |
| /** | |
| * A helper file for providing autocomplete information for your IDE. | |
| * | |
| * This file should not be included in your code, only analyzed by your IDE! | |
| * | |
| * @author Bubba Hines <bubba@stechstudio.com> | |
| */ |
This file contains hidden or 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 | |
| brew install openssl | |
| brew install gd | |
| brew install imagemagick | |
| brew install libmemcached | |
| brew services start memcached | |
| phpbrew install --name 7.3-debug php-7.3 \ | |
| +zts \ | |
| +debug \ |
This file contains hidden or 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 os | |
| import redis | |
| import logging | |
| import string | |
| import random | |
| from collections import namedtuple | |
| from redis.exceptions import RedisError | |
| Lock = namedtuple("Lock", ("valid", "resource", "key", "ttl")) | |
This file contains hidden or 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 | |
| try { | |
| test(); | |
| } catch (TimeoutException $e) { | |
| $e->handle(); | |
| } catch (Throwable $t) { | |
| printf('Some other error occured. %s', $t->getMessage()); | |
| } |
This file contains hidden or 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
| var insults = [ | |
| { | |
| "work": "Heidelberg Disputation from Vol. 31 of Luther's Works.", | |
| "quotes": [ | |
| { | |
| "page": "51", | |
| "quote": "Your sin smells to high heaven." | |
| } | |
| ] | |
| }, |
This file contains hidden or 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 | |
| function non breakable snake case($value, $delimiter = ' ') | |
| { | |
| $value = ucwords(str_replace(['-', '_'], ' ', $value)); | |
| if (! ctype_lower($value)) { | |
| $value = preg_replace('/\s+/u', '', $value); | |
| $value = mb_strtolower(preg_replace('/(.)(?=[A-Z])/u', '$1'.$delimiter, $value), 'UTF-8'); | |
| } |
This file contains hidden or 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 | |
| $rules = [ | |
| '@PSR2' => true, | |
| // Additional Non-PSR2 rules | |
| 'array_syntax' => ['syntax' => 'short'], | |
| 'binary_operator_spaces' => ['align_double_arrow' => true], | |
| 'blank_line_after_opening_tag' => true, | |
| 'blank_line_before_return' => true, |
This file contains hidden or 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 | |
| if (!function_exists('human_filesize')) { | |
| /** | |
| * From http://jeffreysambells.com/2012/10/25/human-readable-filesize-php | |
| * | |
| * @param int $bytes | |
| * @param int $decimals | |
| * @param string $separator | |
| * | |
| * @return string |
This file contains hidden or 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/bash | |
| rm -f /tmp/mtime.$$ | |
| for x in {1..100} | |
| do | |
| /usr/bin/time -f "real %e user %U sys %S" -a -o /tmp/mtime.$$ $@ | |
| tail -1 /tmp/mtime.$$ | |
| done |
This file contains hidden or 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
| variables: | |
| - key: STS_USER | |
| value: "<your name>" | |
| - key: STS_HOME | |
| value: "<your customized home dir>" | |
| - key: AWS_ACCESS_KEY_ID | |
| value: "<your key>" | |
| - key: AWS_SECRET_ACCESS_KEY | |
| value: "<your secret>" | |
| - key: AWS_DEFAULT_REGION |