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
/** @type {PostLoginAction} */ | |
module.exports = async (event, context) => { | |
const approveLogin = () => { | |
return { | |
user: { | |
appMetadata: { | |
actions: 'got-callback' | |
}, | |
userMetadata: { |
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
using Twilio; | |
using Twilio.Rest.Api.V2010.Account; | |
using Twilio.Types; | |
namespace DevIntersection | |
{ | |
class SendSMS | |
{ | |
Twilio.Client.Init( | |
"accountSid", | |
"authToken" |
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
// This #include statement was automatically added by the Particle IDE. | |
#undef MBEDTLS_ECDSA_C | |
// This #include statement was automatically added by the Particle IDE. | |
#include <MQTT-TLS.h> | |
// This #include statement was automatically added by the Particle IDE. | |
#include <ArduinoJson.h> | |
#include "certificate.h" |
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
// Handles incoming messages. Goal is to pair random people who have texted the number. Like anonymous comms. | |
let _ = require('lodash'); | |
exports.handler = function(context, event, callback) { | |
let client = context.getTwilioClient(); | |
let createPair = require(Runtime.getFunctions()['pair-friends'].path); | |
let twilioNumber = event.To; | |
console.log(`Incoming: ${event.Body} - ${event.From}`) | |
client.messages.list({to: twilioNumber }).then((list) => { | |
let cleanedList = _.uniqBy(list, 'from'); |
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
... | |
rtm.on(RTM_EVENTS.MESSAGE, function handleRtmMessage(message) { | |
var isAdmin = _.contains(admins, message.user); | |
if (message.thread_ts) { | |
sendMessageToThread(message).then((message) => { | |
console.log('Message Sent to user.'); | |
}); | |
return; | |
} |
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
// Creates a scrolling rainbow | |
uint32_t rainbow_animation_lut[][16] = { | |
{ 0xff0000,0x101010,0x101010,0x101010, | |
0xff0000,0x101010,0x101010,0x101010, | |
0xff0000,0x101010,0x101010,0x101010, | |
0xff0000,0x101010,0x101010,0x101010}, //Frame1 | |
{ 0xffff01,0xff0000,0x101010,0x101010, | |
0xffff01,0xff0000,0x101010,0x101010, | |
0xffff01,0xff0000,0x101010,0x101010, |
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
# save file | |
# open a console and type: | |
# ruby dads-night-scrambler.rb | |
dads = ['Bruno', 'Evan', 'Geoff', 'Dan', 'Spencer', 'David', 'Kashaka', 'John', 'Sean', 'Andrew', 'Nick', 'Jarod'] | |
puts dads.shuffle | |
# Example Output: | |
# John | |
# Andrew |
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
cd ~/mission-control | |
# update the app | |
git pull origin master | |
# start the app, game does not start automatically | |
nodemon index.js | |
# open a new tab in terminal -> cmd+t | |
# start the public tunnel to this server for admin use |
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 namespace App\Http\Middleware; | |
use Closure; | |
class ValidateAuthyRequest { | |
/** | |
* Handle an incoming request. | |
* | |
* @param \Illuminate\Http\Request $request |
NewerOlder