Skip to content

Instantly share code, notes, and snippets.

<!doctype html>
<html lang="en">
<head>
<!-- Required meta tags -->
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<!-- Bootstrap CSS -->
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.4.1/css/bootstrap.min.css" integrity="sha384-Vkoo8x4CGsO3+Hhxv8T/Q5PaXtkKtu6ug5TOeNV6gBiFeWPGFN9MuhOf23Q9Ifjh" crossorigin="anonymous">
$(function() {
var speakerDevices = document.getElementById("speaker-devices");
var ringtoneDevices = document.getElementById("ringtone-devices");
var outputVolumeBar = document.getElementById("output-volume");
var inputVolumeBar = document.getElementById("input-volume");
var volumeIndicators = document.getElementById("volume-indicators");
var device;
log("Requesting Access Token...");
exports.handler = function(context, event, callback) {
// With timezone:
// In Functions/Configure, add NPM name: moment-timezone, version: 0.5.14
// Timezone function reference: https://momentjs.com/timezone/
let moment = require('moment-timezone');
//
// timezone needed for Daylight Saving Time adjustment
let timezone = event.timezone || 'Australia/Sydney';
console.log("+ timezone: " + timezone);
//
function onOpen() {
var spreadsheet = SpreadsheetApp.getActive();
var menuItems = [
{name: 'Send SMS...', functionName: 'sendSMSFunction_'}
];
spreadsheet.addMenu('| Twilio SMS', menuItems);
}
function sendSms(to, body) {
var messages_url = "https://api.twilio.com/2010-04-01/Accounts/<YOURACCOUNTSID>/Messages.json";
const express = require('express')
const bodyParser = require('body-parser')
const crypto = require('crypto')
const app = express()
const port = 3000
app.use(bodyParser());
app.post('/', (request, response) => {
curl -u xxxxxx:xxxx
https://stash.xxxxxxxx.net/rest/api/1.0/projects/AB/repos/xxxxxxxx/pull-requests?state=MERGED\&limit=100
> t.txt
jdbc:drill:zk=local> SELECT count(*), t.flatdata.author.`user`.`emailAddress`
FROM (SELECT FLATTEN(`values`) as flatdata FROM dfs.rob.`t.json`) t
GROUP BY t.flatdata.author.`user`.`emailAddress`;
// https://davidbeath.com/posts/testing-http-responses-in-nodejs.html
var expect = require('chai').expect;
var request = require('request');
var param1 = xxxxxxxx;
var host = 'http://xxxxx';
var BalanceMethod = 'xxxxxxxxxx&'
var responseFormat = '&returnformat=json';
@robjshaw
robjshaw / batch-spilt
Created November 12, 2015 00:27
playing around with large files
<cfscript>
queue = createobject('component', 'ecgateway.owi.business.services.queue');
folderName = createUUID();
</cfscript>
<cfdirectory action="create" directory="/tmp/#folderName#" mode="777">
<cffile action="copy" source="/tmp/msns_50k.txt" destination="/tmp/#folderName#/" />
<cfexecute name="split" arguments="-l 500 /tmp/#folderName#/msns_50k.txt /tmp/#folderName#/" />
wget -r -nc --user="username" --password="password" ftp://server/folder/folder
@robjshaw
robjshaw / gist:30db8ebc9ddc8daf3d07
Last active August 29, 2015 14:10
setting up hackfest box
# ubuntu 14.10 server
sudo apt-get update
#sudo apt-get install node
#sudo apt-get install nodejs
#sudo apt-get install npm
# set up rest http://www.getrailo.org/index.cfm/whats-up/railo-40-beta-released/features/rest-services/
# set up ngrok on mac https://www.twilio.com/blog/2013/10/test-your-webhooks-locally-with-ngrok.html