Skip to content

Instantly share code, notes, and snippets.

@gengue
gengue / .babelrc
Created February 23, 2017 22:19 — forked from thejmazz/.babelrc
async/await with webpack+babel
{
"presets": ["es2015"],
"plugins": ["transform-async-to-generator"]
}
@gengue
gengue / 0_reuse_code.js
Created February 25, 2016 15:37
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
@gengue
gengue / gist:1d2b6d75619dcb140077
Created September 23, 2015 14:43 — forked from tonymtz/gist:d75101d9bdf764c890ef
Uninstall nodejs from OSX Yosemite
# First:
lsbom -f -l -s -pf /var/db/receipts/org.nodejs.pkg.bom | while read f; do sudo rm /usr/local/${f}; done
sudo rm -rf /usr/local/lib/node /usr/local/lib/node_modules /var/db/receipts/org.nodejs.*
# To recap, the best way (I've found) to completely uninstall node + npm is to do the following:
#go to /usr/local/lib and delete any node and node_modules
cd /usr/local/lib
sudo rm -rf node*
@gengue
gengue / gist:985d53ef848bad362a78
Last active August 29, 2015 14:25 — forked from thiamteck/gist:877276
JQuery Datepicker with Month and Year only
$(document).ready(function(){
$(".monthPicker").datepicker({
dateFormat: 'mm-yy',
changeMonth: true,
changeYear: true,
showButtonPanel: true,
onClose: function(dateText, inst) {
var month = $("#ui-datepicker-div .ui-datepicker-month :selected").val();
class InstanceMixin(object):
def add_arguments(self):
return {'empresa':self.request.empresa}
def get_form_kwargs(self):
"""
Returns the keyword arguments for instanciating the form.
"""
kwargs = super(InstanceMixin, self).get_form_kwargs()
#############################################
# Push de la rama actual
git push origin $rama_actual
#############################################
# Volver a un commit anterior, descartando los cambios
git reset --HARD $SHA1
#############################################
# Ver y descargar Ramas remotas
# -*- coding: utf-8 -*-
'''
Tricky admin -> xadmin merger.
Alex Moiseenko aka IMDagger.
'''
import logging
import types
from functools import wraps, update_wrapper
from django.http import HttpRequest
from django.contrib.admin import ModelAdmin