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/bash | |
# Icons and names | |
ICONS=( | |
"icon_16x16.png:16x16" | |
"icon_16x16@2x.png:32x32" | |
"icon_32x32.png:32x32" | |
"icon_32x32@2x.png:64x64" | |
"icon_128x128.png:128x128" | |
"icon_128x128@2x.png:256x256" |
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 | |
use Illuminate\Database\Migrations\Migration; | |
use Illuminate\Database\Schema\Blueprint; | |
use Illuminate\Support\Facades\Schema; | |
use Illuminate\Support\Facades\Artisan; | |
class CreateDateDimensionTable extends Migration | |
{ | |
/** |
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
{ | |
"preset": "laravel", | |
"rules": { | |
"array_indentation": true, | |
"array_syntax": true, | |
"assign_null_coalescing_to_coalesce_equal": true, | |
"binary_operator_spaces": true, | |
"blank_line_after_namespace": true, | |
"blank_line_after_opening_tag": true, | |
"blank_line_before_statement": true, |
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
#Pulled from Chromium at: https://code.google.com/p/chromium/codesearch#chromium/src/third_party/WebKit/Source/devtools/front_end/toolbox/OverridesUI.js&q=WebInspector.OverridesUI._phones%20file:OverridesUI.js&sq=package:chromium&type=cs&l=310 | |
#Phones | |
Define_phones = [ | |
{deviceName: "Apple iPhone 3GS", width: 320, height: 480, deviceScaleFactor: 1, userAgent: "Mozilla/5.0 (iPhone; U; CPU iPhone OS 4_2_1 like Mac OS X; en-us) AppleWebKit/533.17.9 (KHTML, like Gecko) Version/5.0.2 Mobile/8C148 Safari/6533.18.5", touch: true, mobile: true}, | |
{deviceName: "Apple iPhone 4", width: 320, height: 480, deviceScaleFactor: 2, userAgent: "Mozilla/5.0 (iPhone; U; CPU iPhone OS 4_2_1 like Mac OS X; en-us) AppleWebKit/533.17.9 (KHTML, like Gecko) Version/5.0.2 Mobile/8C148 Safari/6533.18.5", touch: true, mobile: true}, | |
{deviceName: "Apple iPhone 5", width: 320, height: 568, deviceScaleFactor: 2, userAgent: "Mozilla/5.0 (iPhone; CPU iPhone OS 7_0 like Mac OS X; en-us) AppleWebKit/537.51.1 (KHTML, like Gecko) Versi |
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
// In my global app layout, once my app is mounted and ready to listen... | |
import { mapActions, mapGetters } from 'vuex'; | |
const Layout = { | |
mounted() { | |
// set up pusher listeners | |
this.connectToPublicChannel(); | |
this.$watch('authenticated', (auth) => { | |
if (auth) this.connectToUserChannel(); |
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
<script> | |
import * as moment from 'moment-timezone' | |
export default { | |
props: { | |
date: { | |
required: true, | |
default: moment().format() | |
}, | |
locale: { |
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 stuff to redis | |
foreach ($userIds as $uuid) { | |
$this->indexer->addAtIndex("users", $uuid); | |
} | |
// later... retrieve from redis | |
$userID = "fa5352f9-fa1b-48c9-862d-1cb614cc7ed8"; | |
$user = $this->indexer->getAtIndex("users", $userID); |
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 | |
echo "Building data..."; | |
$data = ""; | |
for($i = 0; $i < 1500; $i++) | |
$data .= sha1("H:k - $i - k:H"); | |
echo "OK! (".strlen($data)." bytes)".PHP_EOL; | |
$res = []; |
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/bash | |
PHP=`which php` | |
$PHP php-cs-fixer fix app --rules='{"@PSR2":true,"array_indentation": true,"array_syntax": {"syntax":"short"},"no_unused_imports": true,"object_operator_without_whitespace": true,"ordered_class_elements": {"sortAlgorithm": "none"},"ordered_imports": {"sortAlgorithm": "length"}}' |
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 Repository | |
{ | |
public function findAll(): array | |
{ | |
return $this->connection->project( | |
sprintf('SELECT * FROM %s', self::TABLE_NAME), | |
[], | |
function(array $row): Domain\MyObject { | |
return Domain\MyObject::fromArray($row); |
NewerOlder