Skip to content

Instantly share code, notes, and snippets.

View soutar's full-sized avatar
🤖
automating things

John Soutar soutar

🤖
automating things
  • Glasgow, Scotland
  • 16:21 (UTC +01:00)
View GitHub Profile
@soutar
soutar / foo.js
Created September 30, 2021 14:24
var TASK_IDS = [
"614a6733d00f54c3a3723f18",
"6153aacfc395270181dc80e7",
"61557a7dcbc63da4f2102c5a",
"61427036b923c0436bcc8c6d",
"61425b61cdd0ab0e8c8346db",
"614520c8cdd0ab333683486c",
"61537aa7e307e660815ebc29",
"61539dec254017d9fd66ecc1",
"614e5b6458bdf843d7529e8b",
@soutar
soutar / trace.log
Created October 18, 2016 14:24
Error while updating property 'transform' of a view managed by: RCTView (RN 0.35)
Fatal Exception: com.facebook.react.bridge.JSApplicationIllegalArgumentException: Error while updating property 'transform' of a view managed by: RCTView
at com.facebook.react.uimanager.ViewManagersPropertyCache$PropSetter.updateViewProp(ViewManagersPropertyCache.java:89)
at com.facebook.react.uimanager.ViewManagerPropertyUpdater$FallbackViewManagerSetter.setProperty(ViewManagerPropertyUpdater.java:123)
at com.facebook.react.uimanager.ViewManagerPropertyUpdater.updateProps(ViewManagerPropertyUpdater.java:42)
at com.facebook.react.uimanager.ViewManager.updateProperties(ViewManager.java:34)
at com.facebook.react.uimanager.NativeViewHierarchyManager.createView(NativeViewHierarchyManager.java:220)
at com.facebook.react.uimanager.UIViewOperationQueue$CreateViewOperation.execute(UIViewOperationQueue.java:148)
at com.facebook.react.uimanager.UIViewOperationQueue$DispatchUIFrameCallback.dispatchPendingNonBatchedOperations(UIViewOperationQueue.java:890)
at com.fa
const range = require('array-range');
//
// console.log('Basic value grid')
// const initialGrid = makeGrid(5, 5, 2)
// console.log(initialGrid)
// console.log('Constructed grid')
// const constructedGrid = makeGrid(5, 5, (x, y, rows, columns) => (columns*y+x))
// console.log(constructedGrid)
@soutar
soutar / id_rsa.pub
Created March 11, 2016 10:04
Public SSH key
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDZ5X32RUFXXSIzumZeC3iKf/HzA2VuG2EJtlRKsvihBzeR49WTLBxnm+kKGcBr/33NssEnV5eeAsKN88HiYdlLmZf9NnBWwsV+FFYX852w7AnVDBL6dh4FH6HH4MsYcd+fFZbrgql2Zexx6HTdeWpEN/fAQKMb6ccHFipVhnZlIUI5CGwR+2Vr98jaB1ebdNdTblweGdDO+qRpk4kXhjfa/MsE4JlLndyvz4T69mrO3DGj/YBnIMa43EhTxBn54iCLxiouO3ZalNG7+jKoTXgMAX1WY2o8KKtF66HfJeZ1muKBfhjQj8s7Wl5nQK8q5U0LSMJGZYNapUsJzmttPqCh johnsoutar@*.stv.john
@soutar
soutar / circuit.js
Created December 7, 2015 19:13
Advent of Code - Day 7
import fetch from 'node-fetch';
const OPERATIONS = {
'AND': (x, y) => x & y,
'OR': (x, y) => x | y,
'NOT': (value) => ~ value,
'LSHIFT': (x, y) => x << y,
'RSHIFT': (x, y) => x >> y
}
@soutar
soutar / 1.js
Last active December 7, 2015 17:02
Advent of Code
const input = "(((())))()((((((((())()(()))(()((((()(()(((()((()((()(()()()()()))(((()(()((((((((((())(()()((())()(((())))()(()(()((()(()))(()()()()((()((()(((()()(((((((()()())()((((()()(((((()(())()(())((())()()))()(((((((())(()())(()(((())(()))((())))(()((()())))()())((((())))(()(((((()(())(((()()((()((()((((((((((())(()())))))()))())()()((((()()()()()()((((((())())(((()())()((()()(((()()()))(((((()))(((()(()()()(()(()(((())()))(()(((()((())()(()())())))((()()()(()()(((()))(((()((((()(((((()()(()())((()())())(()((((((()(()()))((((()))))())((())()()((()(()))))((((((((()))(()()(((())())(())()((()()()()((()((()((()()(((())))(()((())()((((((((()((()(()()(((())())())))(())())))()((((()))))))())))()()))()())((()())()((()()()))(()()(((()(())((((())())((((((((()()()()())))()()()((((()()))))))()((((()(((()))(()()())))((()()(((()))()()())())(((())((()()(())()()()(((())))))()())((()))()))((())()()())()())()()(()))())))())()))(())((()(())))(()(())(()))))(()(())())(()(())(()(()))))((()())()))()((((()()))))())))()()())(
@soutar
soutar / proxy.js
Last active November 14, 2022 20:14
Redirect HTTP traffic on Internet Sharing to a local Charles proxy
#!/usr/bin/env node
var options = require('minimist')(process.argv.slice(2), { default: {
cport: 8888
}});
var disable = options.disable || options.d;
var enable = options.enable || options.e;
var status = options.s || options.status;
var child = require('child_process');
@soutar
soutar / apicache.js
Last active August 29, 2015 14:22
API response caching with ObjectCache in Javascript
import ObjectCache from '../ObjectCache';
import ObjectStoreDriver from '../drivers/ObjectStoreDriver';
let cache = new ObjectCache(ObjectStoreDriver);
let requests = 0;
let cacheHits = 0;
function getData () {
let cached = cache.get('apidata');
@soutar
soutar / api.js
Last active August 29, 2015 14:22
PHP vs JS stv apis
api
.get('episodes')
.orderBy(['matId'])
.where({'shortName': 'The Riverside Show'})
.go()
.then((episodes) => {
// episodes is an array of Episode instances, not just plain objects
});
// or even
@soutar
soutar / nvm.sh
Created March 2, 2015 11:00
Swap between Node.js and io.js with NVM
curl https://raw.githubusercontent.com/creationix/nvm/v0.23.3/install.sh | bash
nvm install iojs-1.4.2
nvm install v0.12.0
nvm alias io iojs-1.4.2
nvm alias node v0.12.0
nvm use io