Skip to content

Instantly share code, notes, and snippets.

View franckverrot's full-sized avatar
📚
🥋

Franck Verrot franckverrot

📚
🥋
View GitHub Profile
@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 / 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' }
gem "paymill"
@franckverrot
franckverrot / gist:4749663
Created February 10, 2013 13:57
Remove emojis front GitHub's textareas.
//Paste the line below in your URL address bar to disable emojis
// This line only works on new Issues.
javascript:;jQuery('#issue_body').replaceWith($('<div name="issue[body]"/>').html('')); jQuery('[name="issue[body]"]').replaceWith($('<textarea name="issue[body]"/>').html(''));
@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
require "./tinyparse"
parser = Tinyparse.build do
paren "(", :main, ")", :main
main [:paren, ""]
end
["((()))", "(((", "()()((()()))", "))(("].each do |str|
puts str