Skip to content

Instantly share code, notes, and snippets.


Adan Alvarado aalvarado

Block or report user

Report or block aalvarado

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
aalvarado / inject_images.js
Created Oct 14, 2010
js way of injecting images in li's
View inject_images.js
function addImages(){
var els = document.getElementsByTagName("ul"); //the parent elements we want to inject
var cssClass='list-package'; //the class we want to target
var code = '<img class="checks2" src="images/check2.png" alt="Check"/>';
for(x in els){
if ( els[x].nodeType === 1) { //checks that its a valid node for the getattribute to work
if(els[x].getAttribute('class') == cssClass){ //verfies that it has the class we want
aalvarado /
Created Oct 27, 2010
Snippet from my record line file for pythonscript plugin in n++
class FilePosition:
def __init__(self, bufferId):
self.bufferId = bufferId #sets the bufferId
self.filePositions = [] # where the modified lines will be stored
self.lastPos = 0
self.counter = 0
def addFilePosition(self, pos):
self._findDelete(pos) # checks if the line number is already in the list
aalvarado / regex insde tags
Created Mar 28, 2011
regex match any not self closing tag content (must be wellformed)
View regex insde tags
aalvarado / json req
Created Apr 5, 2011
json req using yql
View json req
var link;
var p;
aalvarado / namespace_encapsulation.js
Created Apr 20, 2011
namespace and object encapsulation in js
View namespace_encapsulation.js
aalvarado / reabase-on-upstream
Created Sep 29, 2011
bashscript for rebasing on upstream master.
View reabase-on-upstream
function parse_git_branch {
git branch --no-color 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/\1/'
if [[ -n "$current_branch" ]]; then
git fetch -v upstream
git checkout master
aalvarado / .bashrc
Last active Sep 27, 2015
View .bashrc
# Probaby windows with msys (old times)
alias ls='ls -A --color=yes'
alias dir='ls -A --color=yes'
alias vi='vim'
alias gb='git branch'
alias gba='git branch -a'
alias gc='git commit -v'
alias gfu='git fetch upstream master:upstream'
alias gf='git fetch origin master:remote-master'
alias gp='git push'
aalvarado / form_loader_replacer.js
Created Feb 24, 2012
jquery button form loader replacer
View form_loader_replacer.js
var form_button_helper = function(){
var loader_image_url = '';
var loader_image = $( document.createElement('img') )
.attr(src, loader_image_url)
toggle_loader : function( button ){
$( button ).toggle();
aalvarado / texplay_on_windows.txt
Created Feb 27, 2012
texplay install on windows
View texplay_on_windows.txt
copy : libfreeglut.a and libfreeglut_static.a to C:\Ruby187\lib
copy GL folder to C:\Ruby187\lib\ruby\1.8\i386-mingw32
You can’t perform that action at this time.