Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/env bash
set -u
set -e
export GIT_WORK_TREE="/var/www/example.com"
export NODE_VERSION="0.10"
echo "--> Checking out..."
git checkout -f
alias glog="git log --graph --pretty=format:'%Cred%h%Creset %an: %s - %Creset %C(yellow)%d%Creset %Cgreen(%cr)%Creset' --abbrev-commit --date=relative"

Setup Mac OS X Mountain Lion

I just replaced the hard drive of my mbp and decided to do a clean install of Mountain Lion (10.8.5) since I was still using Snow Leopard (10.6.8).

I kinda regret for not using Boxen to automate the process, but TBH I have this laptop for almost 3yrs and this is the first time I needed to reinstall everything, maybe the next time...

@caarlos0
caarlos0 / nginx.conf
Last active December 25, 2015 21:29
Config that I'm using right now with Puma + nginx
upstream puma {
server unix://tmp/wealcash.sock fail_timeout=0;
}
server {
listen 80 default deferred;
server_name wealcash.com;
root /var/www/wealcash/current/public;
location ^~ /assets/ {

Sass/Less Comparison

In this document I am using Sass's SCSS syntax. You can choose to use the indented syntax in sass, if you prefer it, it has no functional differences from the SCSS syntax.

For Less, I'm using the JavaScript version because this is what they suggest on the website. The ruby version may be different.

Variables

#!/bin/bash
airmon-ng start wlan0
airbase-ng -e " ̷̴̐خ ̷̴̐خ ̷̴̐خ امارتيخ ̷̴̐خ" -q -c 11 mon0
@caarlos0
caarlos0 / deploy.sh
Last active December 18, 2017 01:00
Continous deploy with Jenkins and Heroku. This is the post-build script.
#!/bin/bash
#
# login in the jenkins server with:
#
# heroku login
# heroku keys:add
#
# Doing so, jenkins will have permission to deploy to
# the heroku remote.
#
@caarlos0
caarlos0 / proxies.sh
Created August 20, 2013 20:14
export all lowercase proxy environment variables to uppercase
#!/bin/bash
#
# export all lowercase proxy environment variables to uppercase.
#
for i in $(env | grep proxy | tr '[:lower:]' '[:upper:]'); do
export $i
done