Skip to content

Instantly share code, notes, and snippets.

View jvalen's full-sized avatar

Javier Valencia jvalen

View GitHub Profile
@jvalen
jvalen / recruiter-reply.sh
Last active April 14, 2017 22:03
Shortcut to generate reply messages to recruiters based on custom templates
#!/bin/bash
### Recruiter reply
#
# A quick shortcut to generate reply messages to recruiters
# based in text files containing the following tags:
#
# {{recruiterName}}
# {{myName}}
#
@jvalen
jvalen / parseXls.py
Last active December 5, 2015 08:31
Parse XLS file to JSON with python
import xlrd
import json
# Example data extracted from: http://esa.un.org/unmigration/TIMSO2013/data/subsheets/UN_MigrantStockByOriginAndDestination_2013T10.xls
# Open the workbook
wb = xlrd.open_workbook('UN_MigrantStockByOriginAndDestination_2013T10.xls')
# Create migrate data structure
migrate = []
@jvalen
jvalen / depthFirstSearcher.js
Created September 25, 2015 00:39
Depth-first searcher: Depth-first search through a tree of nodes. It returns the given name node.
/**
* Depth-first search tree
* @param {string} nodeName - Name of the node to find
* @param {object} tree - Node example: {name: 'a', children: [nodeA, nodeB, ...]}
* @return {object} Returns the node with the given name
*/
function depthFirstSearch(nodeName, tree) {
if (tree.name === nodeName) {
return tree; //Node found
} else {