Skip to content

Instantly share code, notes, and snippets.

View neurotech's full-sized avatar
🍔
We codin'

Tim Douglas neurotech

🍔
We codin'
View GitHub Profile
@neurotech
neurotech / archlinux-install.sh
Last active March 13, 2018 02:53 — forked from wuputah/archlinux-install.sh
Edited to specify Australia/NSW timezone instead of America/Los Angeles
# confirm you can access the internet
if [[ ! $(curl -Is http://www.google.com/ | head -n 1) =~ "200 OK" ]]; then
echo "Your Internet seems broken. Press Ctrl-C to abort or enter to continue."
read
fi
# make 2 partitions on the disk.
parted -s /dev/sda mktable msdos
parted -s /dev/sda mkpart primary 0% 100m
parted -s /dev/sda mkpart primary 100m 100%
Vue.component('status', {
template: `
<h2>Services Status</h2>
<ul>
<li class="{{status.edumate.production}}">Edumate (Production): {{status.edumate.production}}</li>
<li class="{{status.edumate.test}}">Edumate (Test): {{status.edumate.test}}</li>
</ul>
<ul>
<li class="{{status.exchange.production}}">Exchange (Production): {{status.exchange.production}}</li>
<li class="{{status.exchange.test}}">Exchange (Test): {{status.exchange.test}}</li>
@neurotech
neurotech / request.js
Created April 11, 2016 02:03
request object
var exampleRequest = {
headers: {
host: 'localhost',
Authorization: 'Basic username:accessKey',
Server: 'rollbar-relay Example Application'
},
protocol: 'https',
url: '/index.html?foo=bar',
method: 'GET',
body: 'body',
docker@default:~$ df -h
Filesystem Size Used Available Use% Mounted on
tmpfs 1.8G 129.4M 1.6G 7% /
tmpfs 1001.3M 144.0K 1001.1M 0% /dev/shm
/dev/sda1 18.2G 976.7M 16.3G 6% /mnt/sda1
cgroup 1001.3M 0 1001.3M 0% /sys/fs/cgroup
Users 111.9G 82.9G 29.0G 74% /Users
/dev/sda1 18.2G 976.7M 16.3G 6% /mnt/sda1/var/lib/docker/aufs
none 18.2G 976.7M 16.3G 6% /mnt/sda1/var/lib/docker/aufs/mnt/154112d0344b7b4dea525b20dd882e1aeb66c0933911ca7e9bee2fa3c3a1f61a
df: /mnt/sda1/var/lib/docker/containers/154112d0344b7b4dea525b20dd882e1aeb66c0933911ca7e9bee2fa3c3a1f61a/shm: Permission denied
DRIVER VOLUME NAME
local 3d90cab5dfc857198b1ebad8399f392e36450b456a8a3579f207dc68fa06e05f
local 69470a37eb8583430e7c2ee69ea5bb79dc2bec310ee99a0215a70c4b5d25076a
local 6ee3c7673d90c07d5c28f56396cb3d5dedb359032688c67fdbbce367f9326431
-- Example:
-- alc.lates_ytd = 5
-- and
-- alc.diff = 2
SELECT alc.lates_ytd / alc.diff AS "AVERAGE"
FROM example
@neurotech
neurotech / generators.js
Created February 23, 2016 10:44
ES6 Generators
'use strict';
const got = require('got');
const gotIt = url => {
got(url)
.then(data => {
generate.next(data.body);
})
.catch(error => {
@neurotech
neurotech / compile.sh
Created February 18, 2016 09:23
i386 ioquake3 compile script
#!/bin/bash
localPATH=`pwd`
export BUILD_CLIENT="0"
export BUILD_SERVER="1"
export USE_CURL="1"
export USE_CODEC_OPUS="1"
export USE_VOIP="1"
export COPYDIR="~/ioquake3"
IOQ3REMOTE="https://github.com/ioquake/ioq3.git"
IOQ3LOCAL="/tmp/ioquake3compile"
@neurotech
neurotech / shutdown.js
Created October 15, 2015 04:12
Graceful shutdown in node
var shutDown = function() {
logger.info('Gracefully shutting down.');
process.nextTick(function() {
logger.info('Shutting down Express.');
server.close();
});
process.nextTick(function() {
logger.info('Shutting down database connection.');
WITH report_vars AS (
SELECT
('[[From date=date]]') AS "REPORT_START",
('[[To date=date]]') AS "REPORT_END",
('[[Report Period=query_list(SELECT report_period FROM report_period WHERE completed != 1 ORDER BY start_date)]]') AS "REPORT_PERIOD"
FROM SYSIBM.sysdummy1
)
SELECT * FROM report_vars