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 | |
| # Change to a directory higher in the tree by name. | |
| # | |
| # Usage: | |
| # [someone@apc /var/www/mysite/mysubfolder] $ ..s www | |
| # [someone@apc /var/www] $ | |
| # | |
| function ..s() { | |
| CUR_PATH=`pwd` |
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 | |
| file="$1" | |
| function getDimensions() { | |
| local page_size=`pdfinfo "$file" | grep "Page size"` | |
| [[ $page_size =~ ([0-9\.]+)[[:space:]x]+([0-9\.]+) ]] | |
| let page_width="${BASH_REMATCH[1]/.*} / 2" | |
| let page_height="${BASH_REMATCH[2]/.*}" | |
| let offset="-$page_width" | |
| } |
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 | |
| # | |
| # Recompiles all LESS files found (recursively) in the specified directory, e.g. | |
| # | |
| # [someome /public/css]$ recompile-less . | |
| # or | |
| # [someone /myapp]$ recompile-less public/css | |
| find "$1" -name '*.less' | while read line; do | |
| echo "Recompiling $line..." | |
| REPLACE=`echo $line | sed "s|\.less|\.css|"` |
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 | |
| # | |
| # Delete untracked files in a git repository. | |
| # https://gist.github.com/jwarby/697a81fe3941474b3509 | |
| # | |
| # Options: | |
| # | |
| # -h, --help | |
| # show usage information | |
| # -f, --force |
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
| git log --no-merges --author="`git config user.name`" `git rev-parse --abbrev-ref --symbolic-full-name @{u}`..HEAD |
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
| { | |
| /* jwarby's JavaScript Style Guide | |
| * v1.1.0 | |
| * | |
| * https://gist.github.com/75aeeab0793a60d14303 | |
| * ===================================================== | |
| */ | |
| /* | |
| * ENVIRONMENTS |
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
| function! AddPeerReviewerInitials(...) | |
| " Go to the top of the file | |
| execute ':normal gg' | |
| " Find the first comment line, and go up one line | |
| let lineIndex = search('^#') - 1 | |
| " If line is blank, go up another one (my setup adds a new line when amending commit messages) | |
| if !getline(lineIndex) | |
| let lineIndex = lineIndex - 1 |
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 { isFSA } from 'flux-standard-action' | |
| function createFSAComplianceMiddleware() { | |
| const alreadyWarnedAbout = [] | |
| return ({ dispatch, getState }) => next => action => { | |
| const { type } = action | |
| if (!isFSA(action) && alreadyWarnedAbout.indexOf(type) === -1) { | |
| // eslint-disable-next-line no-console |
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 { takeEvery } from 'redux-saga' | |
| import { isFSA } from 'flux-standard-action' | |
| const alreadyWarnedAbout = [] | |
| export function* fsaCompliance() { | |
| yield* takeEvery('*', function* checkCompliance(action) { | |
| const { type } = action | |
| if (!isFSA(action) && alreadyWarnedAbout.indexOf(type) === -1) { |
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
| { | |
| "extends": "eslint:recommended", | |
| "parser": "babel-eslint", | |
| "env": { | |
| "node": true, | |
| "mocha": true, | |
| "es6": true | |
| }, | |
| "rules": { | |
| "import/default": 2, |
OlderNewer