start new:
tmux
start new with session name:
tmux new -s myname
location /resize { | |
alias /tmp/nginx/resize; | |
set $width 150; | |
set $height 100; | |
set $dimens ""; | |
if ($uri ~* "^/resize_(\d+)x(\d+)/(.*)" ) { | |
set $width $1; | |
set $height $2; | |
set $image_path $3; |
{ | |
var thisParser = this; | |
function resolveSymbol(parser, sym){ | |
return (parser.symbols || {})[sym]; | |
} | |
function flatten(array){ | |
var flat = []; | |
for (var i = 0, l = array.length; i < l; i++){ |
# to execute this gist, run the line bellow in terminal | |
\curl -L https://raw.github.com/gist/3875946/install_source_code_pro.sh | sh |
var waitForEl = function(selector, callback) { | |
if (jQuery(selector).length) { | |
callback(); | |
} else { | |
setTimeout(function() { | |
waitForEl(selector, callback); | |
}, 100); | |
} | |
}; |
# Running xdebug in the console, for debugging Laravel artisan commands. Useful as I keep forgetting this one... | |
php -dxdebug.remote_autostart artisan | |
#Running phpcs for 5.3: | |
phpcs -pv --standards= --runtime-set testVersion 5.3 --ignore=*/public/*,*.js,*.css,*/tests/*,*/views/training/* . |
git branch -m old_branch new_branch # Rename branch locally | |
git push origin :old_branch # Delete the old branch | |
git push --set-upstream origin new_branch # Push the new branch, set local branch to track the new remote |
Recommendations of unit types per media type:
Media | Recommended | Occasional use | Infrequent use | Not recommended |
---|---|---|---|---|
Screen | em, rem, % | px | ch, ex, vw, vh, vmin, vmax | cm, mm, in, pt, pc |
em, rem, % | cm, mm, in, pt, pc | ch, ex | px, vw, vh, vmin, vmax |
'use strict'; | |
// simple express server | |
var express = require('express'); | |
var app = express(); | |
var router = express.Router(); | |
app.use(express.static('public')); | |
app.get('/', function(req, res) { | |
res.sendfile('./public/index.html'); |
As Jordan did, I changed the phpunit bootstrap file from 'bootstrap/autoload.php' to 'bootstrap/testing.php'. My version differs only in that I reference an environment variable `PHPUNIT_SEED_DB`, if that variable is present then I seed the database. | |
// bootstrap/testing.php | |
<?php | |
$shouldSeed = getenv('PHPUNIT_SEED_DB'); | |
if ($shouldSeed) { | |
passthru("php artisan --env='testing' migrate:refresh"); | |
passthru("php artisan --env='testing' db:seed --class=TestDatabaseSeeder"); |