A Pen by Franklin Javier on CodePen.
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
git config --global credential.helper # 15 minutes (default). | |
git config --global credential.helper 'cache --timeout=3600' # timeout in seconds | |
# 86400 = 1 day |
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 | |
# ./convertvideo.sh file file | |
# | |
# Ex: | |
# ./convertvideo.sh mp4 webm | |
# ./convertvideo.sh video.avi video.mp4 | |
ls *$1 \ |
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
InfoGenerator.prototype.gitCommit = function gitCommit() { | |
var done = this.async(); | |
this.log('\n\nInitializing Git repository. If this fail, try running ' + | |
chalk.yellow.bold('git init') + | |
' and make a first commit manually'); | |
var async = require('async'); |
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
// dataurl.js | |
// https://github.com/bgrins/devtools-snippets | |
// Print out data URLs for all images / canvases on the page. | |
(function() { | |
console.group("Data URLs"); | |
[].forEach.call(document.querySelectorAll("img"), function(i) { | |
var c = document.createElement("canvas"); |
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
define(function( require, exports ) { | |
'use strict'; | |
var defaults = require('lodash-amd/modern/objects/defaults'), | |
flatten = require('lodash-amd/modern/arrays/flatten'), | |
commands = require('./plugins/core/commands'); | |
... | |
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
imagemin: { | |
dynamic: { | |
files: [{ | |
expand: true, | |
cwd: 'app/assets/img/', | |
src: ['**/*.{png,jpg,gif}'], | |
dest: 'dist/img/' | |
}] | |
} | |
} |
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
sudo add-apt-repository ppa:fossfreedom/byzanz | |
sudo apt-get update && sudo apt-get install byzanz | |
# | |
# If you are behind a firewall | |
# | |
#!/bin/bash | |
sudo apt-get update 2> /tmp/keymissing; |
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
#!/usr/bin/env bash | |
backup_file() { | |
test -e $HOME/$1 && cp -LiR $HOME/$1 $HOME/$1.dotbackup && rm -rf $HOME/$1 | |
true | |
} | |
backup_directory() { | |
test -d $HOME/$1.dotbackup && echo -n "~/$1.dotbackup: " && rm -rI $HOME/$1.dotbackup | |
test -d $HOME/$1 && cp -LR $HOME/$1 $HOME/$1.dotbackup && rm -rf $HOME/$1 |
font: http://cfenollosa.com/misc/tricks.txt
I have marked with a * those which I think are absolutely essential Items for each section are sorted by oldest to newest. Come back soon for more!
BASH
- In bash, 'ctrl-r' searches your command history as you type
- Input from the commandline as if it were a file by replacing 'command < file.in' with 'command <<< "some input text"'
- '^' is a sed-like operator to replace chars from last command
OlderNewer