Skip to content

Instantly share code, notes, and snippets.

View RobSpectre's full-sized avatar

Rob Spectre RobSpectre

View GitHub Profile
@RobSpectre
RobSpectre / test_build.py
Created April 19, 2011 21:51
assertRaises WTF?
#Unit test that is failing.
class Test_BuildApp(unittest.TestCase):
def test_isNotApp(self):
build_fail = build.BuildApp(self.test_app_fail_path)
self.assertRaises(build.BuildAppException, build_fail.isApp())
# Code it is testing (in build.py)
class BuildApp:
def isApp(self):
if "/" in self.path:
@RobSpectre
RobSpectre / gist:999620
Created May 30, 2011 23:14
Tagging an object on FluidINFO
fluidDB.put({
url: 'about/' + encodeURIComponent(sender.tab.url) + '/jeterfilter/contains-jeter',
payload: Math.round(((new Date()).getTime()-Date.UTC(1970,0,1))/1000),
async: false,
username: fluidDBUsername,
password: fluidDBPassword,
success: function(json) {
console.log('URI tagged as containing Jeter.');
}
});
@RobSpectre
RobSpectre / gist:1051708
Created June 28, 2011 17:51
bnter joke
<?php
class LaurenLeto extends PatrickMoberg {
public function doWork($ideas) {
$i = 0;
foreach ($ideas as $idea) {
$this->writeCode($idea);
if ($i >= 4 ) {
$this->highFive();
$i = 0;
@RobSpectre
RobSpectre / script.php
Created August 18, 2011 23:01
Sequential dialing with Twilio
$arr = array('416...','647...','905..');
if (isset($_REQUEST['index'])) {
$index = $_REQUEST['index'];
} else {
$index = 0;
}
$next = $index + 1;
@RobSpectre
RobSpectre / 1smshandler.php
Created August 19, 2011 20:35
SMS Readback
<?php
$number = $_REQUEST['From'];
$body = $_REQUEST['Body'];
$call = $client->account->calls->create(
$from,
$number,
'http://path/to/your/callback.php?body=' . $body
);
@RobSpectre
RobSpectre / a.php
Created August 31, 2011 20:52
Parameter Shuffling in PHP
<?php
$number = $_REQUEST['number'];
echo "I received this - From: ".$number;
?>
@RobSpectre
RobSpectre / conference.xml
Created September 1, 2011 17:43
Conference Example
<Response>
<Dial timeLimit="600">
<Conference startConferenceOnEnter="true">
1234
</Conference>
</Dial>
</Response>
@RobSpectre
RobSpectre / 01_start_conference.php
Created September 22, 2011 20:46
SMS Notification to Conference
<?php
// This is the Voice Request URL to start the conference.
require_once('path/to/Services/Twilio.php');
$ACCOUNT_SID = 'ACxxxxxxxxxxxxxxxxxxxx';
$AUTH_TOKEN = 'yyyyyyyyyyyyyyyyyyyyyyy';
$CALLER_ID = '+1aaabbbcccc';
@RobSpectre
RobSpectre / 1_participants.xml
Created November 9, 2011 15:25
Monitoring calls using Twilio Conference
<Response>
<Dial><Conference>Example</Conference></Dial>
</Response>
@RobSpectre
RobSpectre / 1_gather.xml
Created November 9, 2011 17:10
Demonstration of numDigits in TwiML
<Response>
<Gather numDigits="3" action="/digits.php">
<Say>Enter more than 3 digits.</Say>
</Gather>
</Response>