A Pen by Franklin Javier on CodePen.
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 | |
# ./convertvideo.sh file file | |
# | |
# Ex: | |
# ./convertvideo.sh mp4 webm | |
# ./convertvideo.sh video.avi video.mp4 | |
ls *$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
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 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
// 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 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
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 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
imagemin: { | |
dynamic: { | |
files: [{ | |
expand: true, | |
cwd: 'app/assets/img/', | |
src: ['**/*.{png,jpg,gif}'], | |
dest: 'dist/img/' | |
}] | |
} | |
} |
O browser-sync é um ótimo módulo nodejs. Sua principal funcionalidade é a sincronização de eventos entre os dispositivos conectados. Ou seja, se você scrolla a página, esse evento será replicado em todos os dispositivos magicamente \o/. Dessa forma, tornamos os testes de web apps muito mais produtivos.
- Baixar e instalar o Nodejs
- Abrir o programa "Node.js command prompt"
- Baixar o browser-sync, para isso basta digitar no terminal
npm install -g browser-sync
- Por fim, execute o comando
browser-sync start --proxy "http://www.uol.com.br"
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
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 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
#!/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