NOTE: This is a question I found on StackOverflow which I’ve archived here, because the answer is so effing phenomenal.
If you are not into long explanations, see [Paolo Bergantino’s answer][2].
#!/usr/bin/env zsh | |
# Initialize VPN | |
sudo vpnns up | |
sudo vpnns start_vpn | |
# Popcorn time! | |
sudo ip netns exec frootvpn sudo -u $USER popcorntime | |
# Cleanup |
import json | |
from schematics.types.base import (BaseType, NumberType, IntType, LongType, FloatType, | |
DecimalType, BooleanType) | |
from schematics.types.compound import ModelType, ListType | |
__version__ = '1.0' | |
SCHEMATIC_TYPE_TO_JSON_TYPE = { |
NOTE: This is a question I found on StackOverflow which I’ve archived here, because the answer is so effing phenomenal.
If you are not into long explanations, see [Paolo Bergantino’s answer][2].
from sqlalchemy.engine import create_engine | |
from sqlalchemy.orm.scoping import scoped_session | |
from sqlalchemy.orm.session import sessionmaker | |
class SQLAlchemy: | |
def __init__(self, app=None): | |
if app is not None: | |
self.init_app(app) |
I have spent quite a bit of time figuring out automounts of NFS shares in OS X...
Somewhere along the line, Apple decided allowing mounts directly into /Volumes should not be possible:
/etc/auto_master (see last line):
#
# Automounter master map
#
+auto_master # Use directory service
How do you compare the potential value of different stage companies? And as a company progresses what is the appropriate amount of stock to give new employees?
Using data from Crunchbase and Yahoo Finance we can calculate the average value created per company broken down by how much money they have raised. From this we can then compute relative returns at the different stages, e.g. $1M raised, $10M, $100M, etc.
For this exercise we'll calibrate relative to expected return from a company that's raised $1M.
require 'rubygems' | |
require 'mechanize' | |
FIRST_NAME = 'FIRST_NAME' | |
LAST_NAME = 'LAST_NAME' | |
PHONE = 'PHONE' | |
EMAIL = '[email protected]' | |
PARTY_SIZE = 2 | |
SCHEDULE_RANGE = { :start_time => '19:00', :end_time => '20:30' } |
import collections | |
import json | |
import redis | |
import threading | |
from tornado import gen | |
from tornado import ioloop | |
from tornado import web | |
from tornado.options import define | |
from tornado.options import options | |
import tornadoredis |
#pragma comment (lib, "libuv.lib") | |
#pragma comment (lib, "ws2_32.lib") | |
#pragma comment(lib, "psapi.lib") | |
#pragma comment(lib, "Iphlpapi.lib") | |
#include <stdio.h> | |
#include <stdlib.h> | |
#include <assert.h> | |
#include "../../lib/libuv/include/uv.h" | |
#include "http_parser.h" |
class TrapLoop | |
trap('TERM') { stop! } | |
trap('INT') { stop! } | |
trap('SIGTERM') { stop! } | |
def self.stop! | |
@loop = false | |
end | |
def self.safe_exit_point! |