Skip to content

Instantly share code, notes, and snippets.

Avatar
🐪
Working from anywhere

Salvador Aceves Osuna xalakox

🐪
Working from anywhere
View GitHub Profile
@xalakox
xalakox / gist:2239799
Created Mar 29, 2012
Mapa Embedeable de Dirlocal
View gist:2239799
<iframe style="height: 550px; width: 980px;clear:both" src="http://www.directoriolocal.com/dl/mapa.asp?embeded=true" frameborder="0" width="320" height="240"></iframe>
@xalakox
xalakox / gist:4658929
Last active Dec 11, 2015
Lista de Empresas de SMM y Clientes, para añadir a la lista solo visiten : http://bit.ly/Vsh9TY.
View gist:4658929
PubliHerz
+ El Cantón Toluqueño : https://www.facebook.com/pages/El-canton-toluque%C3%B1o/311674698928180?fref=ts
F:210 I:17 P:8%
Leyenda
------------
F: Followers
I: Usuarios que Interacturaon en la semana mas reciente
P: Porcentaje de Interacción
View awk.sh
#!/bin/sh
awk -F',' '/EXTINF/ {canal=$NF; gsub(/ /,"_",canal); getline url; print canal;print "shoot.sh " canal " " url}' canales.m3u
@xalakox
xalakox / 0_reuse_code.js
Created Mar 31, 2016
Here are some things you can do with Gists in GistBox.
View 0_reuse_code.js
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
View swagger_docker.md

Swagger

Dockerfile

FROM node:4
RUN apt-get -y update && npm install -g coffee-script && npm install -g forever && npm install -g nodemon && npm install swagger -g

WORKDIR /app
# ADD package.json /app/
# ADD config.json /app/
# RUN npm install
@xalakox
xalakox / knight_chessboard.js
Last active Jan 28, 2017
Kight Problem: ¿ How many moves to reach a destination using the knight on a infinite sized chessboard ?
View knight_chessboard.js
#!/usr/bin/env node
function solution(A, B) {
moves = [[2,1],[2,-1],[-2,1],[-2,-1],[-1,+2],[+1,+2],[-1,-2],[+1,-2]]
maxmoves = ~~(A*B/4) || 3
finaldestinations = []
trymove = function(startx,starty,priormoves){
priormoves++;
possiblemoves = moves.filter(function(move){
return startx + move[0] > -1 && starty + move[1] > -1
});
View gist:d27622e1907c45f77b24849862afd90f
const timePromise = (fn, fnName) => {
console.time(fnName)
return eval(fn).then((retval)=>{
console.timeEnd(fnName)
return retval
})
}
@xalakox
xalakox / couchdb csv list
Created Jun 30, 2012
CouchDB JSON to CSV view converter use ?include_docs=true&reduce=false
View couchdb csv list
{
"csv":"function(head, req){
start({
'headers': {
'Content-Type': 'text/csv'
}
});
Array.prototype.unique = function() {
var a = this.concat();