This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const int ledPin = 13; //digital pin your LED is plugged into, I recommend 13 since its next to GND | |
WiFlyClient client; | |
void setup() { | |
//... | |
pinMode(ledPin, OUTPUT); | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void loop() | |
{ | |
//turn on the LED if the TCP socket is open | |
if (client.connected()) { | |
digitalWrite(ledPin, HIGH); | |
} | |
else { | |
digitalWrite(ledPin, LOW); | |
} | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <SPI.h> | |
#include <WiFly.h> | |
char* ssid = "my$ssid$lol"; //enter your SSID here, replace all spaces with $ (ex. "my ssid lol" = "my$ssid$lol") | |
char* pass = "abc123"; //enter your wifi passphrase here | |
char* serverAddress = "1.2.3.4"; //enter the IP of your node.js server | |
int serverPort = 1337; //enter the port your node.js server is running on, by default it is 1337 | |
WiFlyClient client; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
correct_maze_moves = ["left","right","left"] | |
correct_moves_made = 0 | |
def exit_maze(): | |
print "YOU WIN" | |
def enter_maze(): | |
global correct_moves_made | |
print "what way do you go in the maze?" | |
next = raw_input ("> ") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.DS_Store | |
node_modules |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var client = new TwilioClient('ACxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx', 'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx', 'yourwebsite.com'); | |
var phone = client.getPhoneNumber('+18881234567'); | |
app.configure(function () { | |
app.set('view engine', 'jade'); | |
app.set('view options', {layout: false}); | |
app.use(express.cookieParser()); | |
app.use("/bootstrap", express['static'](__dirname + '/bootstrap')); | |
app.use(express.session({ | |
secret: 'secret', | |
key: 'express.sid', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<form id="enter_number"> | |
<p>Enter your phone number:</p> | |
<p><input type="text" name="phone_number" id="phone_number" /></p> | |
<p><input type="submit" name="submit" value="Verify" /></p> | |
</form> | |
<div id="verify_code" style="display: none;"> | |
<p>Calling you now.</p> | |
<p>When prompted, enter the verification code:</p> | |
<h1 id="verification_code"></h1> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
require("Services/Twilio.php"); | |
require("database.php"); | |
// require POST request | |
if ($_SERVER['REQUEST_METHOD'] != "POST") die; | |
// generate "random" 6-digit verification code | |
$code = rand(100000, 999999); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def call_people(self, newbie): | |
self.call_person(newbie) | |
# send 5 texts to people who haven't gotten one in over 4 hours | |
people = Numbers.gql("WHERE last_touched < :1", last_time()).fetch(5) | |
for person in people: | |
self.call_person(person) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
application: cat-facts | |
version: 1 | |
runtime: python | |
api_version: 1 | |
handlers: | |
- url: /.* | |
script: index.py |