Skip to content

Instantly share code, notes, and snippets.

@etelford
etelford / debug.html
Created September 30, 2016 18:38
Bootstrap Responsive Debugging
<div id="u-debug-size">
<div id="u-debug-size__inner"></div>
</div>
  1. Get the deploy URL from Forge (or other PaaS)

  2. Create a dotfile in the root of your project, like .forge, and place the URL in that file

  3. Add the file from step 2 to your .gitignore

  4. Add the following to your .zshrc or .bashrc, etc.

    function deploy() { xargs curl -I < .forge & }

https://github.com/jakubroztocil/httpie
export FIRE='Authorization:Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI'
http -v PUT :8000/profile "$FIRE" email=bob@aol.com avatar=http://google.com age=33
@etelford
etelford / PrimaryColor.php
Last active February 2, 2017 20:00
Get the most common color from an image using the PHP Intervention library
<?php
use Intervention\Image\Filters\FilterInterface;
/**
* A simple filter to get the predominant color from an image using the
* Intervention library (http://image.intervention.io).
*
* Usage with no options:
* $image = Image::make($file);
@etelford
etelford / vim-snippets.sh
Last active August 29, 2015 14:20
Vim snippets
# Copy a line
yy
# Delete a line
dd
# Past line AFTER
p
# Past line BEFORE
@etelford
etelford / bash_snippets.sh
Created April 17, 2015 13:44
Bash snippets
# Find and delete all files old than 3 days
`find . -name "*.sql.gz" -mtime +3 -delete`
@etelford
etelford / git-snippets.md
Last active August 4, 2020 23:06
Various git snippets

Branches

Create a new branch from a specific commit

git checkout -b {new_branch_name} {hash}

Delete local branch

git branch -d {branch_name}

Delete remote branch

git push origin --delete {branch_name}

@etelford
etelford / gist:7529cab70ff93b3be7ad
Created November 8, 2014 14:50
Use emoji in bash prompt
export PS1="\w 🎺 : "