Skip to content

Instantly share code, notes, and snippets.

View TrevorBasinger's full-sized avatar

Trevor Basinger TrevorBasinger

View GitHub Profile
let g:syntastic_javascript_checkers = ['jshint']
nmap <leader><space> :%s/[\ \|\t]*$//g<CR>
" Don't accept arrow keys.
noremap <left> :echo "no!"<cr>
noremap <right> :echo "no!"<cr>
noremap <up> :echo "no!"<cr>
noremap <down> :echo "no!"<cr>
/* jshint laxbreak: true, laxcomma: true */
(function (R, A) {
var mkSensorUrl = function (unit) { return 'http://10.50.2.213:8080/v2/units/' + unit + '/sensors'; },
mkChart = R.curry (function (el, label) {
return new Highcharts.Chart({ chart: { renderTo: el
, defaultSeriesType: 'line' }
, title: { text: 'Live '+label+' data' }
, xAxis: { type: 'datetime'
, tickLength: 1 }
<!doctype html>
<html ng-app="FloFlo">
<head>
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap.min.css" rel="stylesheet">
</head>
<body>
<h1>Hello World</h1>
<div id="main">
/* jshint laxbreak: true, laxcomma: true */
(function (R, F, M, A) {
var log = function (x) { console.log (x); return x; },
mkSensorUrl = function (unit) { return 'http://10.50.2.213:8080/v2/units/' + unit + '/sensors'; },
mkChart = R.curry (function (el, label) {
return new Highcharts.Chart({ chart: { renderTo: el
, defaultSeriesType: 'line' }
, title: { text: 'Live '+label+' data' }
<!doctype html>
<html ng-app="FloFlo">
<head>
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.4/css/bootstrap.min.css" rel="stylesheet">
</head>
<body>
<h1>Hello World</h1>
<div id="main">
var R = require ('ramda'),
M = require ('control.monads'),
bp = require ('body-parser'),
fs = require ('fs'),
express = require ('express'),
log = console.log,
logI = console.logI,
#!/usr/bin/env node
var
rules = [ 'Rule of Modularity: Write simple parts connected by clean interfaces.',
'Rule of Clarity: Clarity is better than cleverness.',
'Rule of Composition: Design programs to be connected to other programs.',
'Rule of Separation: Separate policy from mechanism; separate interfaces from engines.',
'Rule of Simplicity: Design for simplicity; add complexity only where you must.',
'Rule of Parsimony: Write a big program only when it is clear by demonstration that nothing else will do.',
'Rule of Transparency: Design for visibility to make inspection and debugging easier.',
'Rule of Robustness: Robustness is the child of transparency and simplicity.',
API.LMSSetValue("cmi.core.lesson_status", "passed")
API.LMSSetValue("cmi.core.score.raw", "100")
API.LMSSetValue("cmi.core.session_time", "04:32:38.29")
API.LMSCommit ("")
API.LMSFinish ("")
/*
* This is a quick and dirty script for copying files in AWS S3 to other buckets.
* This is written so it can work across AWS accounts.
* You can hack in code to apply work or logic to each file.
*
* For each file, it downloads locally to a tmp file and then starts uploading as soon as possible
* and deletes the file immediately when the upload is done.
*
* Best way to use: Spin up a micro in EC2, install node.js,
* create a directory and install the dependencies with
const
_ = require ('helpers').http,
R = require ('ramda'),
T = require ('data.task'),
M = require ('control.monads'),
mysql = require ('mysql'),
Q = require ('query-builder'),
C = require ('cassandra-driver'),