Skip to content

Instantly share code, notes, and snippets.

View snapshotter.cs
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class Screenshotter : MonoBehaviour {
public TextMesh text;
public void Awake() {
float r = 1, g = 1, b = 1;
// Read r, g and b parameters passed into the query as <URL>?r=0.5?g=0?b=0.1
tomlarkworthy / index.js
Created Jan 6, 2019
Google Cloud Function
View index.js
const puppeteer = require('puppeteer');
let page;
async function getBrowserPage() {
// Launch headless Chrome. Turn off sandbox so Chrome can run under root.
const browser = await puppeteer.launch({args: [
return browser.newPage();
View firebase.json
"hosting": {
"rewrites": [{
"source": "**", "function": "proxy"
View index.js
const express = require('express');
const proxy = require('http-proxy-middleware')
const request = require('request');
const build = "20181223"
const domain = ""
const wordpress = '';
const app = express();
View firebase.json
"hosting": {
"redirects": [{
"source": "/corepox",
"destination": "/",
"type": 301
}, {
"source": "/index.php",
"destination": "/",
"type": 301
from morseapi import MorseRobot
import random
bot = MorseRobot("E8:3C:9F:0E:20:60")
while True:
bot.eye(random.random() * 256)
tomlarkworthy / index.js
Created Aug 18, 2019
Google App Engine Flex toggler
View index.js
const moment = require("moment");
const {google} = require('googleapis');
const gae = google.appengine('v1');
const auth = new google.auth.GoogleAuth({
scopes: ['',
View world-cities.csv
We can't make this file beautiful and searchable because it's too large.
les Escaldes,Andorra,Escaldes-Engordany,3040051
Andorra la Vella,Andorra,Andorra la Vella,3041563
Umm al Qaywayn,United Arab Emirates,Umm al Qaywayn,290594
Ras al-Khaimah,United Arab Emirates,Raʼs al Khaymah,291074
Khawr Fakkān,United Arab Emirates,Ash Shāriqah,291696
Dubai,United Arab Emirates,Dubai,292223
Dibba Al-Fujairah,United Arab Emirates,Al Fujayrah,292231
Dibba Al-Hisn,United Arab Emirates,Al Fujayrah,292239
Sharjah,United Arab Emirates,Ash Shāriqah,292672
View MySceneBehaviour.cs
using UnityEngine;
public class MySceneBehaviour: MonoBehaviour {
private static MySceneParams loadSceneRegister = null;
public MySceneParams sceneParams;
public static void loadMyScene(MySceneParams sceneParams, System.Action<MySceneOutcome> callback) {
MySceneBehaviour.loadSceneRegister = sceneParams;
sceneParams.callback = callback;
View index.ts
// Example in Typescript, nodejs reads a Google Doc if the service account is added as a viewer
// No manual OAUTH2 approval steps required. Just use the google share settings to share
// Use the client_email address found in the crendentials file as the
import fs = require('fs');
import {JWT, auth} from 'google-auth-library';
import {google} from 'googleapis';
const SCOPES = [
// Other options at