Skip to content

Instantly share code, notes, and snippets.

@soarez
soarez / session-cookie-storage.js
Created August 11, 2014 16:26
Session storage based on session cookies
@soarez
soarez / keybase.md
Created September 22, 2014 23:19
keybase.md

Keybase proof

I hereby claim:

  • I am soarez on github.
  • I am soarez (https://keybase.io/soarez) on keybase.
  • I have a public key whose fingerprint is 39E3 D1D6 8DE7 9E7C 38FC FDD0 E92F 5809 1C19 87ED

To claim this, I am signing this object:

@soarez
soarez / ip-to-country-code.js
Created September 29, 2014 08:32
Query maxmind geolite2 country ( ISO_3166 ) downloadable db
var mmdbreader = require('maxmind-db-reader');
module.exports = Open;
function Open(dbPath) {
var db;
var queued = [];
mmdbreader.open(dbPath, dbReady);
return query;
@soarez
soarez / mocha-test.js
Created October 17, 2014 14:21
Node > Selenium > Phantom
/*
First:
$ brew install selenium-server-standalone phantomjs
Have selenium standalone running on a separately:
$ selelium-server
*/
@soarez
soarez / server.js
Created October 20, 2014 09:01
REST my Cookies
/*
* npm i express cors cookie-parser && node server
*/
var url = require('url');
var util = require('util');
var assert = require('assert');
var express = require('express');
var cors = require('cors');
var cookieParser = require('cookie-parser');
@soarez
soarez / Dockerfile
Created January 8, 2015 17:17
phantomjs dockerfile
FROM ubuntu:14.04
MAINTAINER blueoffice
ENV PHANTOMJS_BINARY https://bitbucket.org/ariya/phantomjs/downloads/phantomjs-1.9.8-linux-x86_64.tar.bz2
RUN apt-get update && \
apt-get install -y wget libfontconfig && \
wget $PHANTOMJS_BINARY -O phantomjs.tar.bz2 && \
tar xf phantomjs.tar.bz2 && \
@soarez
soarez / challenge.erl
Created January 13, 2015 12:21
challenge.erl
-module(challenge).
-export([ swap/3 ]).
% no effect on an empty list
swap([ ], _, _) -> [ ];
% no effect on a list with a single item
swap([ H | [] ], _, _) -> [ H ];
% no effect when both indexes are the same
@soarez
soarez / deploy.bash
Last active September 23, 2019 16:15
#!/bin/bash
function deploy {
# Update the rsync target on the server
rsync \
-av \
--delete \
--delete-excluded \
$rsync_ignore_list_param \
$rsync_source/ $target:$rsync_target
@soarez
soarez / intro.md
Created June 2, 2015 11:38
Symmetrical vs asymmetrical crypto

Symmetrical vs asymmetrical crypto


Disclaimer: This content is merely educational. [Don't roll your own crypto][dontDoYourOwnCrypto]. Use TLS and GPG.

These aren't new topics, but if you're reading this maybe you could use a quick