Skip to content

Instantly share code, notes, and snippets.

View jordifebrer's full-sized avatar

Jordi Febrer jordifebrer

View GitHub Profile
@jordifebrer
jordifebrer / git_log.md
Last active March 16, 2022 15:10
Some Git log commands

git log

Help!

git help log

Shows the list of commits (the most recent commits show up first)

git log
@jordifebrer
jordifebrer / console.md
Created August 8, 2014 12:52
Console shortcuts

Console shortcuts

Clean the screen

control + l

Delete the left part of the line

control + u
@jordifebrer
jordifebrer / vim.md
Last active August 29, 2015 14:05
Vim shortcuts

Vim shortcuts

Delete the current line

d + d

Delete the current line + the line below

d + down
@jordifebrer
jordifebrer / misc_git.md
Last active April 11, 2016 15:19
Miscellaneous git stuff

miscellaneous git stuff

Ammend the commit message

$ git commit --amend -m "New commit message"

Change name file to lowercase or uppercase

$ git mv uppercase_file temp_file
@jordifebrer
jordifebrer / bower_package.md
Created August 28, 2014 18:56
How to register a Bower package
git add -A
git commit -m "Commit comment"
git tag -a v0.0.1 -m "Release version 0.0.1"
@jordifebrer
jordifebrer / scala_env.md
Last active August 29, 2015 14:06
Scala env

Display all envs vars

printenv

Set $JAVA_HOME and $SCALA_HOME (Mac OS X)

export JAVA_HOME=$(/usr/libexec/java_home)
export SCALA_HOME=/usr/local/share/scala
export PATH=${PATH}:$JAVA_HOME/bin:$SCALA_HOME/bin
@jordifebrer
jordifebrer / my_site.conf
Last active August 29, 2015 14:07
Simple example of how to force https, redirect an url and proxy in nginx
##
# /etc/nginx/sites-available/my_site.conf
# forces https
server {
listen 80;
return 301 https://my_server$request_uri;
}
server {
@jordifebrer
jordifebrer / vboxmanage.txt
Created June 3, 2015 14:09
vboxmanage commands
# start vm
vboxmanage startvm vm_name
# stop vm
vboxmanage controlvm vm_name poweroff
# clone vm
vboxmanage clonevm vm_name --name new_vm_name --register --mode all
@jordifebrer
jordifebrer / struct_bench.rb
Last active January 29, 2016 10:00
Struct vs OpenStruct vs Hash benchmark
require 'benchmark'
require 'ostruct'
Benchmark.bm 10 do |bench|
bench.report "Hash: " do
10_000_000.times do { name: "John Doe", age: 32 } end
end
bench.report "Struct: " do
Person = Struct.new(:name, :age)
@jordifebrer
jordifebrer / atom.md
Last active April 20, 2018 07:51
Things that I'm using in Atom - GitHub text editor