Skip to content

Instantly share code, notes, and snippets.

View sagnew's full-sized avatar

Sam Agnew sagnew

  • Twilio
  • New York City
View GitHub Profile
@sagnew
sagnew / bash.bas
Last active August 30, 2017 08:16
$BASH 2017 Apple IIe BASIC game
10 REM Clear the screen
20 TEXT : HOME
25 REM DISPLAY WELCOME SCREEN
30 VTAB 4: HTAB 15: PRINT "$BASH RACER"
40 VTAB 13: HTAB 3: PRINT "USE LEFT AND RIGHT ARROW KEYS TO MOVE"
50 VTAB 14: HTAB 7: PRINT "ANY OTHER KEY GOES STRAIGHT"
60 VTAB 21: PRINT "PRESS ANY KEY TO PLAY"
65 VTAB 23: PRINT "SCORE 5000 POINTS TO WIN"
70 REM WAIT FOR KEYPRESS
80 GET KEY$
@sagnew
sagnew / app.py
Created May 23, 2017 20:58
Python debugging code challenge
import re
from flask import Flask, request
from twilio import twiml
app = Flask(__name__)
@app.route('/sms', methods=['POST']): # This decorator has no function. There should be a function def on the next line.
@sagnew
sagnew / flags.swift
Last active May 23, 2017 22:56
Debugging code challenges for ShipIt! at $BASH
enum VNodeFlag: UInt32 {
case Delete = 0x00000001
case Write = 0x00000002
case Extended = 0x00000004
case Attrib = 0x00000008
case Link = 0x00000010
case Rename = 0x00000020
case None = 0x00000080
}
@sagnew
sagnew / pokemon.lua
Last active April 24, 2018 23:01
pokemon
function read_file(name)
local input = io.open(name, 'r')
if input ~= nil then
io.input(input)
content = io.read()
io.close(input)
return content
end
@sagnew
sagnew / node5md.js
Last active August 2, 2018 19:53
Twilio Node API Demo
// The Twilio Node library checks the environment variables
// 'TWILIO_ACCOUNT_SID' and 'TWILIO_AUTH_TOKEN' by default when instantiating a client object.
const client = require('twilio')();
const numbers = new Set()
client.messages.each({
to: '+12019497446',
}, (message) => {
if (!numbers.has(message.from)) {
numbers.add(message.from);