Skip to content

Instantly share code, notes, and snippets.

View ernestohs's full-sized avatar
🐙
coding in progress

/dev/10x ernestohs

🐙
coding in progress
View GitHub Profile
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>Tests</title>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/jasmine/2.3.4/jasmine.min.css">
<script src="http://cdnjs.cloudflare.com/ajax/libs/jasmine/2.3.4/jasmine.min.js"></script>
<script src="http://cdnjs.cloudflare.com/ajax/libs/jasmine/2.3.4/jasmine-html.min.js"></script>
git checkout `git rev-list -n 1 --before="2014-06-10 12:00" master`
@ernestohs
ernestohs / Save for later without loose local changes
Created December 27, 2016 23:27
Stash without revert/reset your local changes
$ git stash && git stash apply
@ernestohs
ernestohs / remove.sugested.facebook.js
Created December 12, 2016 03:50
Delete all Suggested Post
( [].slice.call(document.getElementsByClassName('_5g-l')) ).forEach(function (item) { item.parentNode.remove(); });
git config --global diff.tool bc3
git config --global difftool.bc3 trustExitCode true
git config --global merge.tool bc3
git config --global mergetool.bc3 trustExitCode true
ln -s /usr/local/bin/bcomp /usr/local/bin/bc3
@ernestohs
ernestohs / alias.sh
Last active July 27, 2025 03:16
how lazy I am
# BASH/ZSH ALIASES FOR THE LAZY DEVELOPER
## Git Workflow Aliases
### Push current branch to origin
alias push='git push origin $(git rev-parse --abbrev-ref HEAD)'
### Pull current branch with submodules
alias pull='git pull --recurse-submodules origin $(git rev-parse --abbrev-ref HEAD)'
### Show git status in short format
alias s="git status -s"
### Commit with message (usage: c "commit message")
@ernestohs
ernestohs / couchbd.dump.sh
Last active July 11, 2016 04:22
CouchDB quick and dirty dump script
#!/usr/bin/env bash
set -o errexit
set -o nounset
LOG_LEVEL=5
NO_COLOR=false
set -o pipefail
read -r -d '' usage <<-'EOF' || true # exits non-zero when EOF encountered
-u --username [arg] username (admin) couchdb.
[alias]
# one-line log
l = log --pretty=format:"%C(yellow)%h\\ %ad%Cred%d\\ %Creset%s%Cblue\\ [%cn]" --decorate --date=short
a = add
ap = add -p
c = commit --verbose
ca = commit -a --verbose
cm = commit -m
cam = commit -a -m
@ernestohs
ernestohs / tmux.conf
Last active May 27, 2016 20:33 — forked from spicycode/tmux.conf
The best and greatest tmux.conf ever
# 0 is too far from ` ;)
set -g base-index 1
# Automatically set window title
set-window-option -g automatic-rename on
set-option -g set-titles on
# Set prefix key to Ctrl-a
unbind-key C-b
set-option -g prefix C-a
@ernestohs
ernestohs / mongo.convert2date.js
Created February 20, 2016 21:59
MongoDB (function): Convert a field from String to Date
db.MyCollection.find({ MyFieldDate: { $type: 'string' }}).forEach(function (item) {
item.MyFieldDate = new Date(item.MyFieldDate);
db.MyCollection.save(item);
});