Skip to content

Instantly share code, notes, and snippets.

View Cosmicist's full-sized avatar
🏴

Luciano Longo Cosmicist

🏴
  • Buenos Aires, Argentina
View GitHub Profile
@Cosmicist
Cosmicist / gist:4455397
Last active December 10, 2015 15:38
Boxfile snippet to build a composer project on Pagoda Box
web1:
after_build:
- "if [ ! -f composer.phar ]; then curl -s http://getcomposer.org/installer | php; fi; php composer.phar install"
php_extensions:
- curl
- http
- zip
@Cosmicist
Cosmicist / Git branch bash autocomplete *with aliases*
Created November 30, 2015 19:06 — forked from JuggoPop/Git branch bash autocomplete *with aliases*
Git branch bash autocomplete *with aliases* (add to .bash_profile)
# To Setup:
# 1) Save the .git-completion.bash file found here:
# https://github.com/git/git/blob/master/contrib/completion/git-completion.bash
# 2) Add the following lines to your .bash_profile, be sure to reload (for example: source ~/.bash_profile) for the changes to take effect:
# Git branch bash completion
if [ -f ~/.git-completion.bash ]; then
. ~/.git-completion.bash
# Add git completion to aliases
@Cosmicist
Cosmicist / gist:3977623
Created October 30, 2012 00:44
My bash prompt with git branch and status support
# Reset
Color_Off="\[\033[0m\]" # Text Reset
# Regular Colors
Black="\[\033[0;30m\]" # Black
Red="\[\033[0;31m\]" # Red
Green="\[\033[0;32m\]" # Green
Yellow="\[\033[0;33m\]" # Yellow
Blue="\[\033[0;34m\]" # Blue
Purple="\[\033[0;35m\]" # Purple
@Cosmicist
Cosmicist / gist:3860074
Created October 9, 2012 17:05 — forked from wrboyce/gist:786460
pre-commit hook to automatically minify javascript/css
#!/bin/bash
# Search YUI Compressor anywhere in your home dir
echo "Searching for YUI Compressor..."
YUIC=`find ~/. -type f -name yuicompressor\*.jar`
if ! [ $YUIC ]
then
echo "Unable to find YUI Compressor! Goodbye!"
exit
fi
@Cosmicist
Cosmicist / hg-stash
Created October 5, 2012 17:23
"emulate" git stash in mercurial, copy this file to /usr/bin
#/usr/bin/bash
opt=$1
root=`hg root`
stash=$root/.stash
if [ -z $opt ]
then
opt='save'
fi
@Cosmicist
Cosmicist / .bashrc
Created October 1, 2012 22:59
256-color gnome terminal
# 256-color terminal! Useful for vim color schemes
# Add the following somewhere above the lines that goes:
# case "$TERM" in
# xterm-color) color_prompt=yes;;
# esac
TERM="xterm-256color"
# Colored prompt:
# Search for the following line and uncomment it
force_color_prompt=yes
@Cosmicist
Cosmicist / .vimrc
Created September 28, 2012 16:25
My Vim config
syntax on "not really necessary, but just in case
colorscheme twilight256 "needs https://github.com/flazz/vim-colorschemes
"indents
set shiftwidth=4
set tabstop=4
set softtabstop=4
set expandtab
"features
@Cosmicist
Cosmicist / specification.tpl
Last active September 4, 2015 16:12 — forked from greydnls/specification.tpl
PHPSpec Laravel template php5
<?php
namespace %namespace%;
use PhpSpec\Laravel\LaravelObjectBehavior as ObjectBehavior
use Prophecy\Argument;
class %name% extends ObjectBehavior
{
function it_is_initializable()
@Cosmicist
Cosmicist / uri.js
Created May 20, 2014 02:35 — forked from jlong/uri.js
var parser = document.createElement('a');
parser.href = "http://example.com:3000/pathname/?search=test#hash";
parser.protocol; // => "http:"
parser.hostname; // => "example.com"
parser.port; // => "3000"
parser.pathname; // => "/pathname/"
parser.search; // => "?search=test"
parser.hash; // => "#hash"
parser.host; // => "example.com:3000"
@Cosmicist
Cosmicist / vhost.py
Last active August 29, 2015 14:00 — forked from fideloper/vhost.py
#! /usr/bin/python
from sys import argv
from os.path import exists
from os import makedirs
from os import symlink
from os import system
import getopt
#