Skip to content

Instantly share code, notes, and snippets.

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
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
tomlarkworthy / index.js
Created January 6, 2019 20:18
Google Cloud Function
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: [
'--no-sandbox'
]});
return browser.newPage();
}
{
"hosting": {
"rewrites": [{
"source": "**", "function": "proxy"
}]
}
}
const express = require('express');
const proxy = require('http-proxy-middleware')
const request = require('request');
const build = "20181223"
const domain = "us-central1-corepox-staging.cloudfunctions.net"
const wordpress = 'https://corepoxblog.com';
const app = express();
{
"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")
bot.connect()
while True:
bot.eye(random.random() * 256)
bot.turn(45)
bot.say("hi")
@tomlarkworthy
tomlarkworthy / index.js
Created August 18, 2019 21:05
Google App Engine Flex toggler
const moment = require("moment");
const {google} = require('googleapis');
const gae = google.appengine('v1');
const auth = new google.auth.GoogleAuth({
scopes: ['https://www.googleapis.com/auth/appengine.admin',
'https://www.googleapis.com/auth/cloud-platform',
'https://www.googleapis.com/auth/cloud-platform.read-only']
});
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;
UnityEngine.SceneManagement.SceneManager.LoadScene("MyScene");
@tomlarkworthy
tomlarkworthy / world-cities.csv
Created January 30, 2020 23:07
Cities of the world
We can't make this file beautiful and searchable because it's too large.
name,country,subcountry,geonameid
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