Skip to content

Instantly share code, notes, and snippets.

View luismayta's full-sized avatar
😎
life is fun, so is coding

Lucho Mayta luismayta

😎
life is fun, so is coding
View GitHub Profile
@luismayta
luismayta / solutionAudio.txt
Created March 10, 2012 14:16
solucion a problema de audio en ubuntu
sudo apt-get update
sudo apt-get upgrade
sudo apt-get purge linux-sound-base alsa-base alsa-utils
sudo apt-get install linux-sound-base alsa-base alsa-utils gdm ubuntu-desktop
@luismayta
luismayta / pre-commit.sh
Created April 3, 2012 21:30
PHP CodeSniffer pre-commit hook for git
#!/bin/bash
# PHP CodeSniffer pre-commit hook for git
#
# @author Soenke Ruempler <soenke@ruempler.eu>
# @author Sebastian Kaspari <s.kaspari@googlemail.com>
#
# see the README
PHPCS_BIN=/usr/bin/phpcs
PHPCS_CODING_STANDARD=PEAR
@luismayta
luismayta / gist:2399497
Created April 16, 2012 15:33 — forked from ppanyukov/gist:1035407
Using p4merge with Git Mac OS X or Ubuntu

Git config

$ git config --global -e
[merge]
    keepBackup = false;
    tool = p4merge
[mergetool "p4merge"]
    cmd = p4merge "$BASE" "$REMOTE" "$LOCAL" "$MERGED"

keepTemporaries = false

@luismayta
luismayta / prompt-branch.sh
Created April 24, 2012 17:11
nombre del branch en el prompt
#Code for bash, goes into ~/.bashrc:
function parse_git_dirty {
[[ $(git status 2> /dev/null | tail -n1) != "nothing to commit (working directory clean)" ]] && echo "*"
}
function parse_git_branch {
git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e "s/* \(.*\)/[\1$(parse_git_dirty)]/"
}
export PS1='\u@\h \[\033[1;33m\]\w\[\033[0m\]$(parse_git_branch)$ '
@luismayta
luismayta / p4merge
Created April 25, 2012 16:29
configurar p4merge para git
p4merge*
Create a new text file in /usr/local/bin called p4merge and add the following lines:
#!/bin/sh
/home/usuario/Contents/MacOS/p4merge $*
Make the script executable by entering this command:
chmod +x p4merge
@luismayta
luismayta / config-p4merge.sh
Created April 25, 2012 16:31
git config for p4merge
#git config --global -e
[merge]
keepBackup = false;
tool = p4merge
[mergetool "p4merge"]
cmd = p4merge "$BASE" "$LOCAL" "$REMOTE" "$MERGED"
keepTemporaries = false
trustExitCode = false
keepBackup = false
[diff]
@luismayta
luismayta / README.md
Created June 7, 2012 22:17 — forked from rduplain/README.md
Connect to MSSQL using FreeTDS / ODBC in Python.

Goal: Connect to MSSQL using FreeTDS / ODBC in Python.

Host: Ubuntu 11.10 x86_64

Install:

sudo apt-get install freetds-dev freetds-bin unixodbc-dev tdsodbc
pip install pyodbc sqlalchemy

In /etc/odbcinst.ini:

@luismayta
luismayta / gist:2934987
Created June 15, 2012 06:21 — forked from puentesarrin/gist:2927255
Simple cache for Tornado Handler using MongoDB
class CacheBaseHandler(tornado.web.RequestHandler):
def prepare(self):
cached = self.application.db.cache.find_one({"slug": self.request.path})
if cached is not None:
self.write(cached["content"])
self.finish()
def render_string(self, template_name, **kwargs):
html_generated = \
@luismayta
luismayta / git branch deleted
Created August 28, 2012 02:49
deleted branch
#deleted branch merged
git branch --merged | grep -v \* | xargs git branch -D
#deleted branch with before bug
git branch --merged | grep 'bug' | xargs git branch -D
@luismayta
luismayta / create branch
Created August 28, 2012 02:54
create one branch desde una ruta remota
#create one branch desde una ruta remota
git checkout -b new_develop --track origin/develop