Skip to content

Instantly share code, notes, and snippets.

View ThomasRooney's full-sized avatar

Thomas Rooney ThomasRooney

View GitHub Profile
@ThomasRooney
ThomasRooney / invoke.ts
Created January 9, 2022 16:05
appsync invoke
import * as https from 'https';
import { URL } from 'url';
const AWS = require('aws-sdk');
export function assertEnv(key: string): string {
if (process.env[key] !== undefined) {
return process.env[key]!;
}
throw new Error(`expected environment variable ${key}`);
@ThomasRooney
ThomasRooney / useDataStore.ts
Last active December 8, 2021 11:36
Created for https://reflow.io : react hooks for aws amplify datastore that fill @connection links
import { useEffect, useState } from 'react';
import { DataStore } from '@aws-amplify/datastore';
import type {
PersistentModel,
PersistentModelConstructor,
ProducerModelPredicate,
ProducerPaginationInput,
} from '@aws-amplify/datastore';
export const useDataStore = <T extends PersistentModel>(
@ThomasRooney
ThomasRooney / discover-chromecast.sh
Last active June 1, 2022 17:55
Discover Chromecast with devicename via mDNS
#! /bin/sh
if ! which dns-sd > /dev/null
then
echo "Requires dns-sd"
exit
fi
if (( $# < 1 )) ; then
echo "Requires devicename as an argument"

Keybase proof

I hereby claim:

  • I am thomasrooney on github.
  • I am thomasrooney (https://keybase.io/thomasrooney) on keybase.
  • I have a public key ASBoX6Ce4RakCSUXiabeT0cTZCZmOvo8-NGuhm68-Y8lbQo

To claim this, I am signing this object:

impssh() {
shellServerIndex=$((RANDOM%4+1))
username="tr111"
shellServer=shell$shellServerIndex.doc.ic.ac.uk
if (( $# >= 1 )) ; then
ssh -t $username@$shellServer "ssh $1"
@ThomasRooney
ThomasRooney / BLOCKS-README.md
Created January 20, 2014 17:34
How to run blocks

How to run the blocks project

Building

from the root of the repository (installs packages/databases as per requirement, recommend doing on a VM)

sudo ./deployment/provisioning/common.sh ./deployment/puppet/gamenode/
@ThomasRooney
ThomasRooney / rubyserve-oneline
Created January 8, 2014 23:11
ruby http serve oneliner
ruby -rsocket -e "require 'webrick';include WEBrick;s = HTTPServer.new(:Port => 80, :DocumentRoot => Dir::pwd);trap(\"INT\"){ s.shutdown };s.start;"
ruby -rsocket -e "require 'webrick';include WEBrick;s = HTTPServer.new(:Port => 8080, :DocumentRoot => \"/opt/blocks/client/bin\");trap(\"INT\"){ s.shutdown };s.start;"
146.169.44.231