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 / .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 / .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 / 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 / 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 / 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: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
server {
listen 80;
server_name www.example.com;
root /var/www/vhosts/example.com/public/;
location /
{
index index.php index.html index.htm;
}
@Cosmicist
Cosmicist / gist:4532649
Created January 14, 2013 19:33
Symfony2 nginx server config
server {
listen 80;
server_name symfony2;
root /var/www/symfony2/web;
error_log /var/log/nginx/symfony2.error.log;
access_log /var/log/nginx/symfony2.access.log;
location / {
@Cosmicist
Cosmicist / index.html
Created March 5, 2013 04:11
Simple JavaScript string formatter with possibility for custom regex
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>String format</title>
</head>
<body>
<h2>Default</h2>
<p>
<pre>Replacing &lt;strong&gt;{foo}&lt;/strong&gt; and &lt;strong&gt;{bar}&lt;/strong&gt;</pre>
/*
* Adapted from: http://code.google.com/p/gaequery/source/browse/trunk/src/static/scripts/jquery.autogrow-textarea.js
* Updated from: https://gist.github.com/thomseddon/4703968
*
* Works nicely with the following styles:
* textarea {
* resize: none;
* transition: 0.05s;
* -moz-transition: 0.05s;
* -webkit-transition: 0.05s;