{{ message }}

Instantly share code, notes, and snippets.

🐪
Working from anywhere

🐪
Working from anywhere
Created Nov 17, 2020
View jest.setup.js
 const { equals } = require('expect/build/jasmineUtils'); expect.extend({ toContainObject(received, argument) { const pass = (() => { if (Array.isArray(argument)) { return equals(received, expect.arrayContaining(argument.map(arg => expect.objectContaining(arg))) ); }
Created Apr 6, 2020
keybase.md
View gist:8d20259ab93584c798cbdeff179471d0
 ### Keybase proof I hereby claim: * I am xalakox on github. * I am xalakox (https://keybase.io/xalakox) on keybase. * I have a public key ASCRbSiHwJ6Mr6gHbg7Pji1a6AEn6ZcI4raErwtL7leFlAo To claim this, I am signing this object:
Created Mar 7, 2018
promise time debug function
View gist:d27622e1907c45f77b24849862afd90f
 const timePromise = (fn, fnName) => { console.time(fnName) return eval(fn).then((retval)=>{ console.timeEnd(fnName) return retval }) }
Last active May 10, 2017
esnextbin sketch
Last active Apr 24, 2017
esnextbin sketch
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 });
Last active Jan 4, 2017
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