Skip to content

Instantly share code, notes, and snippets.

View jlizanab's full-sized avatar

José Lizana jlizanab

View GitHub Profile
@jlizanab
jlizanab / gist:5909641
Created July 2, 2013 14:12
Create backup of actual directory on dropbox (bash). You can add this feature to your .bash_profile or .bashrc, and call it from a terminal when you need to back up a folder.
backupOnDropbox(){
STRNOW=`date +"%Y%m%d%H%M"`;
STRNAMEDIR=`basename $PWD`_;
STRDESCFILE='_backup.zip';
zip -r $STRNAMEDIR$STRNOW$STRDESCFILE *
mv $STRNAMEDIR$STRNOW$STRDESCFILE ~/Dropbox/
}
@jlizanab
jlizanab / gist:5962100
Last active December 19, 2015 13:29
prints a line like separation (depending on the width of the window)
mySep(){
printf \\r
COLU=`tput cols`
for ((a=1; a <= $COLU ; a++))
do
printf "-"
done
printf \\n
}
@jlizanab
jlizanab / 0_reuse_code.js
Created August 16, 2017 17:43
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
#add the following code to your bash_profile
#open new terminal to test it
base64d(){
printf "`echo $1 | base64 --decode` Copied to clipboard!\n"
echo $1 | base64 --decode | pbcopy
}
base64e(){
</*
<form name="formTest" novalidate>
<input id="rut" name="rut" type="text"
ng-model="rut" placeholder="Ej. 11.222.333-4" autocomplete="off" ng-pattern="regexRut"
ng-change="validateRut(formTest.rut)" onkeypress="return (event.charCode >= 48 && event.charCode <= 57) || event.charCode == 45 || event.charCode == 75 || event.charCode == 107;">
</form>
*/
//in Controller
vm.regexRut ="^([0-9]+-[0-9Kk])$";