Skip to content

Instantly share code, notes, and snippets.

View thomasmichaelwallace's full-sized avatar
🐧

thomas michael wallace thomasmichaelwallace

🐧
View GitHub Profile
@thomasmichaelwallace
thomasmichaelwallace / updater-script
Created August 7, 2012 20:51
Fixed updater-script for Nexus S Jelly Bean OTA and Busybox to JRO03E
ui_print("4.1.1 Modified for Busybox.");
mount("ext4", "EMMC", "/dev/block/platform/s3c-sdhci.0/by-name/system", "/system");
assert(file_getprop("/system/build.prop", "ro.build.fingerprint") == "google/soju/crespo:4.0.4/IMM76D/299849:user/release-keys" ||
file_getprop("/system/build.prop", "ro.build.fingerprint") == "google/soju/crespo:4.1.1/JRO03E/403059:user/release-keys");
assert(getprop("ro.product.device") == "crespo" ||
getprop("ro.build.product") == "crespo");
ui_print("Verifying current system...");
show_progress(0.100000, 0);
assert(apply_patch_check("/system/app/ApplicationsProvider.apk", "da8ace2279cd01b9d7aadcb44e3645fc627da3f8", "d6ab70bf18fc590f08c70b27f1e7c2498abe6509"));
set_progress(0.000063);
@thomasmichaelwallace
thomasmichaelwallace / post.md
Created May 12, 2016 10:09
testing-gist-io

This is just a test.

I kinda wanted to know what it's like.

Afternoon All,

Thank you for attending/avoiding (delete as appropriate) my bewildering talk on React and Redux.

Here’s the application I built in a day to demonstrate the wonderful world of React/Redux: https://github.com/thomasmichaelwallace/Retrospectively

If you want to relive the presentation, start at BrownBag.md and follow the instructions. If you want to run it, follow the vague guidance in ReadMe.md.

Below is a semi-curated long list of resources/libraries for anyone who would like to learn more.

@thomasmichaelwallace
thomasmichaelwallace / chaosPromise.js
Created July 11, 2017 17:53
A promise wrapper for mocking asynchronous functions with a bit of chaos.
const chaosPromise = result => (
Math.random() >= 0.5
? Promise.resolve(result)
: new Promise(res => setTimeout(() => res(result), Math.random() * 1000))
);
@thomasmichaelwallace
thomasmichaelwallace / Dockerfile
Created July 12, 2017 20:07
A simple dockerfile for working with native npm modules in serverless.
FROM amazonlinux:latest
# set locale
RUN echo LC_ALL=en_GB.UTF-8 >> /etc/environment
ENV LC_ALL=en_GB.UTF-8
# install node and build tools
RUN curl --silent --location https://rpm.nodesource.com/setup_6.x | bash - && \
yum install -y nodejs gcc-c++ make git
@thomasmichaelwallace
thomasmichaelwallace / extend-proxy-timeout.config
Created July 13, 2017 16:16
Elastic Beanstalk extension command to increase the nginx upstream proxy timeout.
container_commands:
extend_proxy_timeout:
command: |
sed -i '/\s*location \/ {/c \
location / { \
proxy_connect_timeout 300;\
proxy_send_timeout 300;\
proxy_read_timeout 300;\
send_timeout 300;\
' /tmp/deployment/config/#etc#nginx#conf.d#00_elastic_beanstalk_proxy.conf
@thomasmichaelwallace
thomasmichaelwallace / ajv-tutorial-1.js
Last active July 14, 2017 22:52
A hello world for ajv.
import Ajv from 'ajv';
const ajv = new Ajv({ allErrors: true });
@thomasmichaelwallace
thomasmichaelwallace / ajv-tutorial-2.js
Created July 14, 2017 22:52
Continuing a hello world in ajv.
const schema = {
type: 'object',
additionalProperties: false,
required: ['hello'],
items: { hello: { type: 'string' } }
};
@thomasmichaelwallace
thomasmichaelwallace / ajv-tutorial-3.js
Created July 14, 2017 22:53
Finishing an ajv hello world tutorial.
const test = ajv.compile(schema);
const isValid = test(obj);
return isValid ? obj : { obj, error: test.errors }
@thomasmichaelwallace
thomasmichaelwallace / eb-memory-monitor.config
Last active September 26, 2019 10:56
EB CloudWatch memory usage reporting .ebextensions file
container_commands:
00download:
command: "wget http://aws-cloudwatch.s3.amazonaws.com/downloads/CloudWatchMonitoringScripts-1.2.1.zip"
ignoreErrors: true
01extract:
command: "unzip -o CloudWatchMonitoringScripts-1.2.1.zip"
ignoreErrors: true
02rmzip:
command: "rm CloudWatchMonitoringScripts-1.2.1.zip"
ignoreErrors: true