Skip to content

Instantly share code, notes, and snippets.

@joakin
joakin / beautify-folder.sh
Created January 17, 2012 15:26
Bash script to beautify all the js files in a folder using js-beautify
#!/bin/bash
PATZ=$1
for i in $(find $PATZ -name "*.js")
do
js-beautify $i > "$i.out" && mv "$i.out" $i
done
@joakin
joakin / hack.sh
Created April 8, 2012 14:48 — forked from erikh/hack.sh
OSX For Hackers
#!/usr/bin/env sh
##
# This is script with usefull tips taken from:
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx
#
# install it:
# curl -sL https://raw.github.com/gist/2337706/hack.sh | sh
#
@joakin
joakin / diff1.diff
Created October 4, 2012 14:37
little js refactor
index 89cd18d..38e5379 100644
--- a/c:/Users/OLTRAJO/Desktop/js1.js
+++ b/c:/Users/OLTRAJO/Desktop/js2.js
@@ -1,12 +1,12 @@
- function setToggler(){
- $('.toggle-item').on('change', controlToggler);
+ function setToggler() {
- function controlToggler(){
@joakin
joakin / pepito.md
Created October 29, 2012 11:52
La historia de Pepito por Alberto Noguera

de: Definicion de pepito - burbuja.info

La historia de Pepito por Alberto Noguera.

A mí me gustan esos que se cogen el hipotecón, con un sueldecito un 30% mayor que la cuota mensual, y si les dices algo responden: "siempre puedo refinanciar". Le preguntas a cuántos años es la hipoteca, y resulta que es a 30, cuando no 40.

Vamos a tomar un ejemplo ficticio. Pongamos que Pepito Relámpago llega al mercado inmobiliario en el año 2006, se compra su zulito de Pladur por 200.000 ? y lo financia a 30 años. Poniendo un 4% de interés, le sale una cuota de 954 ?. Como le han hecho encargado recientemente, allí en la carpintería, llega ya a los 1.200 ? mensuales. Sus padres le han hecho el aval, con su otro zulito, en este caso de los del yugo y las flechas. Sabe que al principio irá un poco agobiado, pero "es la única forma de meterse", "están todos así", la inflación irá rebajando la cuota

@joakin
joakin / getUrlParamete.js
Created December 11, 2012 09:47 — forked from sampel/getUrlParamete.js
Piece of javascript code: gets the service parameter rom the url (GET) and check if contains something
/* Fast and easy way of taking a param from the query string */
// From what I gathered, 2 space indentation is prefered in JS
// If this is a script included in a page, wrap it in a closure to avoid global
// name creation and clashes
!function() {
/* Named functions on the `root` scope, so that they can be loaded before the
@joakin
joakin / custom.ahk
Created May 27, 2013 09:32
Autohotkey custom script. Features reverse scroll wheel and CapsLock to Ctrl map.
; # - winkey
; + - shift
; ^ - ctrl
; ! - alt
;
; Reverse scrolling
;
WheelUp::
@joakin
joakin / cntlm.ini
Created May 27, 2013 10:54
cntlm.ini configuration for a NTLMv2 proxy inside a corporation
#
# Cntlm Authentication Proxy Configuration
#
Username oltrajo
Domain PRODUCTION
PassNTLMv2 C2A94D94E4F46F14AAGBE3C56669F4ED # From cntlm -M
# Company name substituted for privacy
@joakin
joakin / externs.md
Created April 24, 2014 11:00
Clojurescript dummy externs

First, add an :externs key to the :compiler map in project.clj:

                ;...
                :compiler {;...
                           :externs ["externs.js"]
                           ;...
                           }

externs.js is the name of the file that we use to declare our protected symbols. You could use whatever name you wanted to.

I've been having trouble with my resume editing for a long time. A long time ago it was a word document, afterwards it became a odt document and migrated to libreoffice/openoffice, and later I redid the resume using the europass template provided by the european union following a standard format (also in odt).

The problems I've found are:

@joakin
joakin / index.js
Last active August 29, 2015 14:05
requirebin emojify multiline marked sketch
var emoji = require('emoji-images');
var marked = require('marked');
var insertCSS = require('insert-css');
var multiline = require('multiline');
var emojiPath = 'http://www.tortue.me/emoji/';
var emojify = function(text) { return emoji(text, emojiPath); }
insertCSS(multiline(function() {/*@preserve