Skip to content

Instantly share code, notes, and snippets.

View ainformatico's full-sized avatar

Alejandro Dev. ainformatico

View GitHub Profile
@ainformatico
ainformatico / getElementById.js
Created April 26, 2013 08:14
getElementById alias
$ = function()
{
var args = Array.prototype.slice.call(arguments, 0),
doc = document;
return doc.getElementById.apply(doc, args);
}
@ainformatico
ainformatico / README.md
Last active December 14, 2015 02:19
Validator for commit messages when creating a new commit. You should rename the ruby file as `commit-msg` and place it in `repo/.git/hooks` and do not forget `chmod +x commit-msg`

Checkmmit

Validator for commit messages when creating a new commit.

Install

Rename the other attached file as commit-msg and place it in repo/.git/hooks do not forget chmod +x commit-msg if needed.

Add your own validations

@ainformatico
ainformatico / gist:1994933
Created March 7, 2012 18:24
Print all fingerprints for public keys
cd ~/.ssh;for a in `ls *.pub`; do ssh-keygen -lf $a;done
@ainformatico
ainformatico / gist:1975109
Created March 4, 2012 22:22
quick rename
for a in `ls`; do mv $a "_$a" ;done;
@ainformatico
ainformatico / script.bat
Created November 8, 2011 12:05
Executing Cygwin Bash scripts on Windows
:: Execute a bash script with the same filename, source: bit.ly/ef7iQw
@echo off
setlocal
if not exist "%~dpn0.sh" echo Script "%~dpn0.sh" not found & exit 2
set _CYGBIN=C:\cygwin\bin
if not exist "%_CYGBIN%" echo Couldn't find Cygwin at "%_CYGBIN%" & exit 3
:: Resolve ___.sh to /cygdrive based *nix path and store in %_CYGSCRIPT%
for /f "delims=" %%A in ('%_CYGBIN%\cygpath.exe "%~dpn0.sh"') do set _CYGSCRIPT=%%A
:: Throw away temporary env vars and invoke script, passing any args that were passed to us
endlocal & %_CYGBIN%\bash --login "%_CYGSCRIPT%" %*