Skip to content

Instantly share code, notes, and snippets.

View stefanobernardi's full-sized avatar

Stefano Bernardi stefanobernardi

View GitHub Profile

Operations Manager - Aragon Association

Aragon is an open source, decentralized project fighting for the freedom to organize. We believe that decentralized organizations can solve the world's worst problems.

The Aragon Association is a non-profit that oversees the development of the Aragon Project. It’s formed by a very small and close-knit team distributed around the world, who cares a lot about the future of decentralized organizations.

We're now looking for an Operations Manager, to help us optimize the financial and operational structure of the Aragon Association,and own the operations needed in running the Association in a smooth way.

The Aragon Association is actively committed to create a diverse team, and actively seeks applications from under-represented groups.

@stefanobernardi
stefanobernardi / filecoin.rb
Last active September 11, 2017 17:31
Filecoin cap calculation
coins = 0.00 # just to initialize.
price = 1.00 # the price Filecoin states is the minimum
amount_raised = 52000000.00 # they've said they already sold $52M in the presale
total_filecoin_sold = 85000000.00 # the number of Filecoins already sold in the presale. This would be $52M/price (price was $0.75 and investors could choose up to 30% discount. I'm using 85M coins as an assumption (min 69M max 99M).
average_investment = 100000.00 # I'm already being generous here
while total_filecoin_sold < (200000000.00 - coins) do # 200M is the max amount of coins
price = amount_raised/40000000.00 # this is their function, it's always more than $1
price = price * 0.9 # if you want to model an average discount people will choose
coins = average_investment / price # the amount of coins you get with every investment
amount_raised = amount_raised + average_investment # let's add the investment to the total raised

Keybase proof

I hereby claim:

  • I am stefanobernardi on github.
  • I am ste (https://keybase.io/ste) on keybase.
  • I have a public key whose fingerprint is 912E E6E0 E91A F035 8575 AC68 CB5F 8AB8 008A A6E0

To claim this, I am signing this object:

@stefanobernardi
stefanobernardi / application_controller.rb
Created September 23, 2012 07:07
Multiple omniauth providers and omniauth-identity on the main user model
class ApplicationController < ActionController::Base
protect_from_forgery
protected
def current_user
@current_user ||= User.find_by_id(session[:user_id])
end
def signed_in?
rvm install 1.9.3-p125 --patch xcode-debugopt-fix-r34840.diff --with-readline-dir=$rvm_path/usr --with-openssl-dir=$rvm_path/usr --with-tcl-lib=/usr --with-tk-lib=/usr
@stefanobernardi
stefanobernardi / sorcery_async_email.rb
Created February 27, 2012 02:05 — forked from ilake/sorcery_async_email.rb
Async Emails With Sorcery by delayed_job
#config/initializers/sorcery_async_email.rb
module Sorcery
module InstanceMethods
def generic_send_email(method, mailer)
config = sorcery_config
config.send(mailer).delay.send(config.send(method),self)
end
end
end
end
@stefanobernardi
stefanobernardi / app.rb
Created February 7, 2012 03:11
Sinatra rocks
require 'rubygems'
require 'sinatra' # it's all about you
# require 'stripe' -> stripe for payments
require 'twilio-ruby' #-> twilio to send sms
# require 'mail' -> with this I can send email
# return some json stuff
get "/" do
content_type :json
# I do some pretty cool stuff here.