Skip to content

Instantly share code, notes, and snippets.

View franckverrot's full-sized avatar
📚
🥋

Franck Verrot franckverrot

📚
🥋
View GitHub Profile
@franckverrot
franckverrot / lmdb.tcl
Created April 30, 2017 16:14 — forked from antirez/lmdb.tcl
LMDB -- First version of Redis written in Tcl
# LVDB - LLOOGG Memory DB
# Copyriht (C) 2009 Salvatore Sanfilippo <antirez@gmail.com>
# All Rights Reserved
# TODO
# - cron with cleanup of timedout clients, automatic dump
# - the dump should use array startsearch to write it line by line
# and may just use gets to read element by element and load the whole state.
# - 'help','stopserver','saveandstopserver','save','load','reset','keys' commands.
# - ttl with milliseconds resolution 'ttl a 1000'. Check ttl in dump!

What I Wish I'd Known About Equity Before Joining A Unicorn

Disclaimer: This piece is written anonymously. The names of a few particular companies are mentioned, but as common examples only.

This is a short write-up on things that I wish I'd known and considered before joining a private company (aka startup, aka unicorn in some cases). I'm not trying to make the case that you should never join a private company, but the power imbalance between founder and employee is extreme, and that potential candidates would

From 739265f2f2c54d8be56ad58d7c863193f0ce472d Mon Sep 17 00:00:00 2001
From: Franck Verrot <franck@verrot.fr>
Date: Thu, 26 May 2016 10:12:29 -0700
Subject: [PATCH] * parse.y : Replace squotes with dquotes
---
parse.y | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/parse.y b/parse.y
@franckverrot
franckverrot / keybase.md
Created April 3, 2016 12:10
keybase.md

Keybase proof

I hereby claim:

  • I am franckverrot on github.
  • I am franckverrot (https://keybase.io/franckverrot) on keybase.
  • I have a public key whose fingerprint is 05D3 7235 54C6 21E6 C891 43A3 B465 58BA 184F F10E

To claim this, I am signing this object:

@franckverrot
franckverrot / google_cloud_vision_api.rb
Created February 26, 2016 05:42
Google Cloud Vision API client
require 'openssl'
require "base64"
require 'net/http'
require 'json'
image_path = ARGV[0]
puts "Reading image #{image_path}..."
b64_data = Base64.encode64(File.open(image_path, "rb").read)
api_key = ENV.fetch('GOOGLE_CLOUD_VISION_API_KEY') { raise 'Missing env variable GOOGLE_CLOUD_VISION_API_KEY' }
@franckverrot
franckverrot / test.rb
Created October 26, 2015 08:14
`try` vs `try!` vs `.?` vs `method_missing as a blackhole`
require 'active_support'
TryIsNotSafe = Class.new(RuntimeError)
SafeOperatorIsNotSafe = Class.new(RuntimeError)
MethodMissingIsNotSafe = Class.new(RuntimeError)
def does_it_raise(&block)
begin
result = block.call
puts "SUCCESS, result: #{result.inspect}"
rescue TryIsNotSafe, SafeOperatorIsNotSafe, MethodMissingIsNotSafe => e
Dictionary! par Wordset
Dictionary! est une application dictionnaire en anglais facile à utiliser et sans superflu pour iPhone, enrichie par la communauté Wordset.org. Il vous aide à trouver les mots facilement, même si vous ne pouvez pas l'épeler correctement. Il saura très bien deviner les mots en anglais que vous recherchez.
La totalité du dictionnaire est installée sur votre smartphone ! Si vous êtes déconnecté(e) ou tout simplement hors-ligne, votre application contient des dizaines de milliers de définitions directement sur votre smartphone. En ligne, vous pourrez rechercher des définitions plus détailles. En somme, un vrai dictionnaire !
Fonctionnalités :
* Recherche ultra-rapide
* Totalité du dictionnaire sur votre smartphone
* Pas besoin de connexion !
@franckverrot
franckverrot / test.pl
Created October 7, 2015 13:59
Function composition in Perl 6
sub infix:<|\>> ($f, $g) {
-> $x {
$f($g($x))
}
};
my $mult_2 = -> $x { $x * 2 };
my $plus_3 = -> $x { $x + 3 };
my $compound = $mult_2 |> $plus_3;
@franckverrot
franckverrot / pipeline-operator.rb
Last active September 23, 2015 11:21
Pipeline operator in Ruby
# mul_x_y :: [Fixnum, Fixnum] -> Fixnum
mul_x_y = ->(x, y) { x * y }
# adder :: Fixnum -> (Fixnum -> Fixnum)
adder = ->(base) {
->(input) { input + base }
}
# add_two :: Fixnum -> Fixnum
add_two = adder[2]
@franckverrot
franckverrot / test.log
Last active August 29, 2015 14:27
Python vs Ruby on a closed stdout
##### Python
λ (echo 'before'; exec 1>&-; python -c 'print("after")')
before
close failed in file object destructor:
sys.excepthook is missing
lost sys.stderr
### Ruby
λ (echo 'before'; exec 1>&-; ruby -e 'puts("after")')
before