Awesome PHP has been relocated permanently to its own Github repository. No further updates will made to this gist.
Please open an issue for any new suggestions.
#!/bin/bash | |
# Chrome Refresh | |
# | |
# nik cubrilovic - nikcub.appspot.com | |
# | |
# Simple applescript browser reloader for Google Chrome. It will either open a | |
# new tab with the url passed in as an argument or refresh an existing tab. | |
# | |
# Link this up with watchr to auto-refresh browser windows when you save files |
Awesome PHP has been relocated permanently to its own Github repository. No further updates will made to this gist.
Please open an issue for any new suggestions.
Copy, with line wrapping!
If you've been trying to copy/paste text from a multi-pane tmux
session with the mouse, you've probably been pretty pissed at the blissful ignorance a terminal application has of the rodent in your hand.
The alternative, which is quote-unqoute native copy/pasting using copy-mode takes a bit to get used to. So this is one solution for copying and pasting lines from a session with correct line wrapping behaviour, albeit keyboard only.
Disclaimer
Since copy-mode has similar concepts of marks, regions, and temp buffers to Emacs .. you'll probably find it straight forward if you're familar with Emacsen. For people using vi-mode in tmux
, the same still applies but obviously the default key bindings will differ alot from what I show below.
#!/bin/bash | |
while : | |
do | |
clear | |
git --no-pager log -$1 --graph --all --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --date=relative | |
sleep 1 | |
done |
<?php | |
/* | |
* /path/to/migrations/directory/Version20121011141021.php | |
*/ | |
namespace ExampleMigrations; | |
use Doctrine\DBAL\Migrations\AbstractMigration; | |
use Doctrine\DBAL\Schema\Schema; | |
class Version20121011141021 extends AbstractMigration |
<?php | |
//This is all you need to configure. | |
$app_key = ''; | |
$app_token = ''; | |
//These are our constants. | |
$api_base = 'https://api.twitter.com/'; | |
$bearer_token_creds = base64_encode($app_key.':'.$app_token); |
THIS GIST WAS MOVED TO TERMSTANDARD/COLORS
REPOSITORY.
PLEASE ASK YOUR QUESTIONS OR ADD ANY SUGGESTIONS AS A REPOSITORY ISSUES OR PULL REQUESTS INSTEAD!
#!/bin/bash -ex | |
# Wrapper for 'docker save' fixing, | |
# https://github.com/dotcloud/docker/issues/3877 | |
# In addition: this script will always save exactly one image (possibly | |
# multiple tags). | |
IMAGE=$1 | |
TARGET=$2 | |
NAME=`echo $IMAGE | awk -F':' '{print $1}'` | |
ID=`docker inspect $IMAGE | python -c "import sys,json; print json.load(sys.stdin)[0]['id']"` |
Finding Packer-generated AMIs automatically after builds
The basic technique is to have Packer add a tag with a unique value during the build, and use AWS' built-in filtering capabilities to find that specific AMI after the build finishes.
A simple script with a few niceties that allows for multiple requestAnimationFrame
calls, and FPS pinning.
The script polyfills rAF if required, then overloads requestAnimationFrame
and cancelAnimationFrame
with a process that allows multiple frames to be queued up for rAF to run.
This is useful if there are multiple animations running on the page, you want all the callbacks to happen at once, and not on multiple rAF calls. This script is meant as a drop-in solution to that problem.