This file contains 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
<h3><perch:content id="company_name" type="text" label="Company Name" html="false" required="true" title="true" /></h3> | |
<perch:content id="testimonial" type="textarea" label="Testimonial" textile="true" editor="markitup" imagewidth="640" imageheight="480" /> | |
<strong><perch:content id="name" type="text" label="Name" html="false" required="true" /></strong><br> | |
<strong><perch:content id="job_role" type="text" label="Job Role" html="false" required="true" /></strong> |
This file contains 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
// bad | |
dates = ["2013-04-02T08:27:01.209Z", "2013-04-26T08:27:01.209Z", "2013-05-16T08:27:01.209Z", "2013-05-23T08:27:01.209Z", "2013-05-24T08:27:01.209Z"]; | |
// good | |
dates = ["2013-04-25T08:27:01.209Z", "2013-04-31T08:27:01.209Z", "2013-05-06T08:27:01.209Z", "2013-05-13T08:27:01.209Z", "2013-05-20T08:27:01.209Z", "2013-05-24T08:27:01.209Z"]; | |
function checkEmbedded(dates) { | |
// takes an array of ISO string formatted dates and determines | |
// they have signed in a minimum 1x per week over the past four weeks | |
var today = new Date(); |
This file contains 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
SET FOREIGN_KEY_CHECKS = 0; | |
SET @tables = NULL; | |
SELECT GROUP_CONCAT(table_schema, '.', table_name) INTO @tables | |
FROM information_schema.tables | |
WHERE table_schema = 'replacenameofdb'; -- specify DB name here. | |
SET @tables = CONCAT('DROP TABLE ', @tables); | |
PREPARE stmt FROM @tables; | |
EXECUTE stmt; | |
DEALLOCATE PREPARE stmt; |
This file contains 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
function checkEmbedded(dates) { | |
// takes an array of ISO string formatted dates and determines | |
// they have signed in a minimum 1x per week over the past four weeks | |
var today = new Date(); | |
var week = 7*24*60*60*1000; | |
dates.sort(); | |
dates.reverse(); | |
if (dates.length < 4){ | |
// hasn't visited more than 4 times yet | |
return false; |
This file contains 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
[2013-05-28T14:16:39.451147, INFO] Starting sandbox ... | |
[2013-05-28T14:16:39.451952, INFO] Loading sandboxed code ... | |
[2013-05-28T14:16:39.517862, INFO] Loaded user +27845091190: {"current_state":"initial_state","answers":{"second_state":"yes","prebirth_6_q_1_a_1":"q_2","first_state":"Yes!","name_set":"Mike","register_prebirth_2":"1","prebirth_6_q_2":"prebirth_6_q_2_a_1","welcome_state":"yes","register_all_hivinfo":"yes","register_all_smsoptin":"yes","third_state":"yes","register_all_thanksandstart":"yes","name_confirm":"yes","initial_state":"pregnant","prebirth_6_q_1":"prebirth_6_q_1_a_1","register_all_1":"pregnant"}} | |
[2013-05-28T14:16:39.519574, INFO] Content: Help | |
[2013-05-28T14:16:39.618876, ERROR] | |
[2013-05-28T14:16:39.625199, ERROR] undefined:112 | |
[2013-05-28T14:16:39.627181, ERROR] response = im.config.output.help;; | |
[2013-05-28T14:16:39.640407, ERROR] ^ | |
[2013-05-28T14:16:39.641987, ERROR] TypeError: Cannot read property 'help' of undefined | |
[2013-05-28T14:16:39.643240, ERROR] at undefined:112:52 |
This file contains 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
{ | |
"user_store": "cheep_cheep" | |
"transport": "sms", | |
"output": { | |
"help": "CheepCheep to send SMSes to list. Add to list with '+0821234556'. Remove with '-0821234556'. Send with 'SEND Your Message'. Message limited to 100 letters." | |
} | |
} |
This file contains 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
{ | |
"user_store":"sms_sender", | |
"sms_tag": ["pool", "addr"] | |
} |
This file contains 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 vumigo = require("vumigo_v01"); | |
var jed = require("jed"); | |
if (typeof api === "undefined") { | |
// testing hook (supplies api when it is not passed in by the real sandbox) | |
var api = this.api = new vumigo.dummy_api.DummyApi(); | |
} | |
var Promise = vumigo.promise.Promise; | |
var success = vumigo.promise.success; |
This file contains 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
// Single - Works | |
p.add_callback(function(result) { return self.send_sms(im, msg, recipients[0])}); | |
// Fails | |
for (var i=0;i<recipients.length;i++){ | |
p.add_callback(function(result) { return self.send_sms(im, msg, recipients[i])}); | |
} |
This file contains 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
import requests, pprint, json | |
ORG = "imsickofmaps" | |
repo = "simplestorymaker" | |
GH_TOKEN = "token" | |
r = requests.get('https://api.github.com/repos/%s/%s/issues' % (ORG, repo), headers={'Authorization': 'bearer %s' % GH_TOKEN}) | |
pprint.pprint(json.loads(r.text)) |