Skip to content

Instantly share code, notes, and snippets.

View pateketrueke's full-sized avatar

Alvaro Cabrera Durán pateketrueke

View GitHub Profile
@pateketrueke
pateketrueke / mysqlfu.sql
Created November 13, 2013 05:41
MySQL snippets (WUT)
CREATE DATABASE <dbname>;
CREATE USER '<dbuser>'@'localhost' IDENTIFIED BY '<password>';
GRANT ALL PRIVILEGES ON <dbname> . * TO '<dbuser>'@'localhost';
REVOKE ALL PRIVILEGES ON <dbname> . * FROM '<dbuser>'@'localhost';
@pateketrueke
pateketrueke / addsite.sh
Last active December 27, 2015 17:59
Adds and removes custom vhosts on Apache2
#!/bin/sh
MYSELF="$(whoami)"
WWWDIR="$HOME/www"
DOMAIN=$1
VHOSTDIR="/usr/local/apache2/conf/vhosts"
if [ "$MYSELF" != "root" ]; then
echo "You must execute this as root"
else
@pateketrueke
pateketrueke / slash-lang.txt
Last active December 26, 2015 15:19
Slash lang!
# ubuntu
git clone git@github.com:slash-lang/slash.git
sudo apt-get install libmarkdown2-dev libmysqlclient-dev libyajl-dev libgmp-dev
# apache2
sudo apt-get install apache2 apache2-prefork-dev
sudo ln -s /usr/bin/apxs2 /usr/bin/apxs
sudo ln -s /usr/sbin/apache2 /usr/bin/httpd
# make
@pateketrueke
pateketrueke / Monokai.tmTheme
Last active December 24, 2015 21:09
My Monokai-dark settings
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>name</key>
<string>Monokai</string>
<key>settings</key>
<array>
<dict>
<key>settings</key>
@pateketrueke
pateketrueke / Literate CoffeeScript.tmLanguage
Last active December 24, 2015 15:09
Literate CoffeeScript for SublimeText
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>fileTypes</key>
<array>
<string>coffee.md</string>
<string>litcoffee</string>
</array>
@pateketrueke
pateketrueke / config.fish
Last active December 20, 2015 20:29
Fish settings!
set -U EDITOR vim
set -U fish_greeting
set __fish_git_prompt_showdirtystate 'yes'
set __fish_git_prompt_showupstream 'yes'
set __fish_git_prompt_showuntrackedfiles 'yes'
set __fish_git_prompt_color_branch yellow
set __fish_git_prompt_char_cleanstate '✔'
set __fish_git_prompt_char_dirtystate '⚡'
@pateketrueke
pateketrueke / dnsmasq.md
Created July 9, 2013 05:03
Settings for local.dev

resolv.conf.d/virtual-hosts

nameserver 127.0.0.1

dhclient-enter-hooks.d/virtual-hosts

prepend domain-name-servers 127.0.0.1;

dnsmasq.d/virtual-hosts

@pateketrueke
pateketrueke / .gitconfig
Last active December 18, 2015 16:08
My Git setup
[core]
editor = vim
[alias]
s = status
st = status
ci = commit
b = branch
br = branch
ba = branch -a
co = checkout
@pateketrueke
pateketrueke / config.json
Created June 18, 2013 19:23
My SublimeText2 setup
/* Preferences */
{
"auto_complete": false,
"bold_folder_labels": true,
"color_scheme": "Packages/Color Scheme - Default/Monokai.tmTheme",
"detect_indentation": false,
"drag_text": false,
"ensure_newline_at_eof_on_save": true,
"font_face": "Andale Mono",
@pateketrueke
pateketrueke / .bashrc
Created April 4, 2013 17:25
Search text inside source-code with Git
gs(){
if [ -z "$1" ]; then
echo "Missing search string"
else
git rev-list --all | (
while read revision; do
git grep -F "$1" $revision
done
)
fi