Skip to content

Instantly share code, notes, and snippets.

Avatar

Randy Lubin randylubin

View GitHub Profile
View cocktail_order.py
import csv
all_orders = [[
'Name',
'Shipping Tracking'
]]
with open('orders.csv', 'rU') as f:
reader = csv.DictReader(f)
for row in reader:
@randylubin
randylubin / lambda.py
Last active Jul 24, 2017
Send sweet nothings with Lambda and Twilio
View lambda.py
import base64
import json
import os
import urllib
import random
from urllib import request, parse
TWILIO_SMS_URL = "https://api.twilio.com/2010-04-01/Accounts/{}/Messages.json"
TWILIO_ACCOUNT_SID = os.environ.get("TWILIO_ACCOUNT_SID")
View learntocode.md

Learn to Code!

Summary and links

Start withs some games

  • Lightbot
  • CodeCombat
  • Checkio.org

Design a simple site with HTML and CSS

  • Noodle around with Scratchpad.io
View gist:10296969
### Keybase proof
I hereby claim:
* I am randylubin on github.
* I am rl (https://keybase.io/rl) on keybase.
* I have a public key whose fingerprint is 2F4E 623E 0C65 4ED7 8457 1CC1 4FDE 20C4 00E0 3423
To claim this, I am signing this object:
View keybase.md

Keybase proof

I hereby claim:

  • I am randy on github.
  • I am rl (https://keybase.io/rl) on keybase.
  • I have a public key whose fingerprint is 2F4E 623E 0C65 4ED7 8457 1CC1 4FDE 20C4 00E0 3423

To claim this, I am signing this object:

@randylubin
randylubin / proxyServer
Created Jul 1, 2012
Node.js Multi-App Proxy Server with Forwarding
View proxyServer
var http = require('http'),
httpProxy = require('http-proxy');
//
// Setup proxy server with forwarding
//
var options = {
router: {
'proxytest.randylubin.com': '127.0.0.1:7200',
'randylubin.com': '127.0.0.1:7200',
@randylubin
randylubin / gist:2821692
Created May 28, 2012
Node proxy server
View gist:2821692
var http = require('http'),
httpProxy = require('http-proxy');
//
// Setup proxy server with forwarding
//
var options = {
router: {
'proxytest.randylubin.com': '127.0.0.1:7200',
'randylubin.com': '127.0.0.1:7200',
@randylubin
randylubin / gist:2160209
Last active Oct 2, 2015
Unfair Flip Solution
View gist:2160209
import random
def fairFlip():
return random.randrange(2)
startingOdds = .625
def unfairFlip(odds):
if odds >= .5:
if fairFlip() == 1:
You can’t perform that action at this time.