Skip to content

Instantly share code, notes, and snippets.

View matheusfaustino's full-sized avatar
💪
Daily workout: git push, git pull

Matheus Faustino matheusfaustino

💪
Daily workout: git push, git pull
View GitHub Profile
@matheusfaustino
matheusfaustino / jms_translation.sh
Created January 14, 2016 11:33
It is a shell command for running extract command without overflow
for i in de en es fr it pt tr; do app/console translation:extract --config=app $i; done
@matheusfaustino
matheusfaustino / .gitconfig
Last active February 8, 2018 13:50
.gitconfig - Changing git color
# This is Git's per-user configuration file.
[core]
# Please adapt and uncomment the following lines:
editor = vim
filemode = false
[push]
default = matching
[help]
@matheusfaustino
matheusfaustino / electron.sublime-project
Last active February 10, 2016 16:12
Sublime project config for running electron app using build systems from sublime(by console) - Linux and OSX
{
"build_systems":
[
{
"name": "Electron",
"cmd": ["electron", "$project_path"],
"selector": "source.js",
"osx": {
"cmd": ["electron", "$project_path/main.js"],
@matheusfaustino
matheusfaustino / .bashrc
Created November 18, 2016 12:20
git alias
#
# Git alias
#
alias changesgit="git diff --name-status -r"
alias gdiff="git diff --stat -r"
alias ghead="git show -s --pretty='tformat:%h, %s, %ad' --date=short"
alias gl="git log --color --graph --pretty=format:'%Credbold%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit"
alias gb="git branch -v"
alias g="git status -sb"
alias gc="git commit"
@matheusfaustino
matheusfaustino / sleep_after.sh
Last active November 24, 2016 14:49
function that put OSX to sleep after some seconds/minutes/hours. I use it when I am listening music at night
sleep_after() {
local sleep_time=$1;
if [[ $2 = "hour" ]] then
sleep_time=$(($sleep_time*60*60));
elif [[ $2 = "min" ]] then
sleep_time=$(($sleep_time*60));
elif [[ !$2 ]] then
echo "options is not valid: $2";
return 0;
@matheusfaustino
matheusfaustino / MongoShell-Makefile
Last active November 23, 2016 11:08
Start mongoshell from a makefile. I recommend it for simple tasks, like a exercise in class.
shell:
@docker start mongoserver
@docker start mongoshell -i
@docker stop mongoshell mongoserver
connect: createMongo
docker run -it --name mongoshell --link mongoserver:mongo mongo sh -c 'exec mongo "$$MONGO_PORT_27017_TCP_ADDR:$$MONGO_PORT_27017_TCP_PORT"'
@docker stop mongoshell mongoserver
createMongo:
# https://stackoverflow.com/a/32727069
sudo killall taskgated
codesign -fs gdb-cert "$(which gdb)"
r -> run
p -> print
d -> display expression
set -> set a valeu to a var
b -> breakpoint
bt -> backtrace
c -> continue
n -> next, doesn't go inside
s -> step, goes inside
where -> backtrace
@matheusfaustino
matheusfaustino / php.net.always.english.user.js
Last active July 22, 2017 14:04
php.net always in English (UserScript)
// ==UserScript==
// @name php.net always in English
// @namespace php.net.english
// @author matheusfaustino
// @description set always english for php.net
// @include *php.net/manual/*/*
// @exclude *php.net/manual/en/*
// @version 1
// @grant none
// ==/UserScript==
@matheusfaustino
matheusfaustino / mozilla.dev.docs.always.eng.user.js
Last active July 22, 2017 14:04
Mozilla Dev Website Always Eng (UserScript)
// ==UserScript==
// @name Mozilla Dev Website Always Eng
// @namespace mozilla.dev.docs.always.eng
// @author matheusfaustino
// @description Always change the language of mozilla docs to English
// @include https://developer.mozilla.org/*/docs/*
// @exclude https://developer.mozilla.org/en*/docs/*
// @version 1
// @grant none
// ==/UserScript==