Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View dahernan's full-sized avatar

David Hernandez dahernan

View GitHub Profile
@dahernan
dahernan / Triplet Loss.ipynb
Created December 26, 2017 15:25 — forked from kylemcdonald/Triplet Loss.ipynb
Experimenting with triplet loss embeddings.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

Keybase proof

I hereby claim:

  • I am dahernan on github.
  • I am dahernan (https://keybase.io/dahernan) on keybase.
  • I have a public key whose fingerprint is DF74 80B5 424D 0DDD 96AA 9E4E 0E34 CAA0 068D E384

To claim this, I am signing this object:

@dahernan
dahernan / bio.md
Last active August 29, 2015 14:17
short bio

David Hernandez is an independent Software Engineer in London, he helps companies to improve their software. He worked different countries like Spain, UK and Australia, participating in projects like the BBC London Olympics 2012, helping to achieve Continuous Delivery at Atlassian, or delivering services to the citizens at the Government Digital Services.

You can find David speaking and collaborating at Go London User Group, because Go is his favourite language.

@dahernan on Twitter

@dahernan on Github

@dahernan
dahernan / gist:fd8d6be29f5655a39989
Created March 17, 2015 11:58
LUA Redis Snowflake
$ redis-cli set sequence 1
$ redis-cli set node_id 1
-- id.lua
local epoch = 1288834974657
local seq = tonumber(redis.call('INCR', 'sequence')) % 4096
local node = tonumber(redis.call('GET', 'node_id')) % 1024
local time = redis.call('TIME')
local time41 = ((tonumber(time[1]) * 1000) + (tonumber(time[2]) / 1000)) - epoch
return (time41 * (2 ^ 22)) + (node * (2 ^ 12)) + seq
@dahernan
dahernan / auth.go
Last active August 29, 2015 14:15
Basic auth login route
// example for Minimal Auth
// it does not compile is just as a guide for rolling your own
// some code for login by http post
func (a *AuthRoute) Login(w http.ResponseWriter, req *http.Request) {
var authForm map[string]string
err := RequestToJsonObject(req, &authForm)
if err != nil {
Render().JSON(w, http.StatusUnauthorized, nil)

##Recommendation Engine Services

####IREUS Recommendation Engine for stores as SaaS

http://www.ireus.net/

####Plista

@dahernan
dahernan / gist:10652080
Created April 14, 2014 14:15
bash_prompt
# @gf3’s Sexy Bash Prompt, inspired by “Extravagant Zsh Prompt”
# Shamelessly copied from https://github.com/gf3/dotfiles
# Screenshot: http://i.imgur.com/s0Blh.png
if [[ $COLORTERM = gnome-* && $TERM = xterm ]] && infocmp gnome-256color >/dev/null 2>&1; then
export TERM=gnome-256color
elif infocmp xterm-256color >/dev/null 2>&1; then
export TERM=xterm-256color
fi
$ docker run -d elasticsearch
$ docker ps
ID IMAGE COMMAND CREATED STATUS PORTS
29fd16250848 elasticsearch:latest /bin/sh -c elasticse 32 seconds ago Up 32 seconds 9200->9200
@dahernan
dahernan / gist:6149703
Created August 4, 2013 08:32
docker images
$ docker images
REPOSITORY TAG ID CREATED SIZE
ubuntu 12.04 8dbd9e392a96 3 months ago 131.5 MB (virtual 131.5 MB)
ubuntu 12.10 b750fe79269d 4 months ago 24.65 kB (virtual 180.1 MB)
ubuntu latest 8dbd9e392a96 3 months ago 131.5 MB (virtual 131.5 MB)
ubuntu precise 8dbd9e392a96 3 months ago 131.5 MB (virtual 131.5 MB)
ubuntu quantal b750fe79269d 4 months ago 24.65 kB (virtual 180.1 MB)
elasticsearch latest ef2487bb289d 52 seconds ago 12.29 kB (virtual 558.7 MB)
@dahernan
dahernan / gist:6149626
Created August 4, 2013 07:56
elasticsearch Dockerfile
FROM ubuntu
MAINTAINER dahernan "dahernan@gmail.com"
# Java 7
RUN echo "deb http://ppa.launchpad.net/webupd8team/java/ubuntu precise main" | tee -a /etc/apt/sources.list
RUN apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys EEA14886
RUN apt-get update
RUN echo oracle-java7-installer shared/accepted-oracle-license-v1-1 select true | /usr/bin/debconf-set-selections
RUN apt-get install oracle-java7-installer -y