Skip to content

Instantly share code, notes, and snippets.

@chrismatheson
chrismatheson / keybase.md
Created November 27, 2018 08:28
keybase.md

Keybase proof

I hereby claim:

  • I am chrismatheson on github.
  • I am chrismatheson (https://keybase.io/chrismatheson) on keybase.
  • I have a public key ASA2q1K-TzmPJXB0t6TgkpwWv8K1eoytVWQVIPGRYXPZpAo

To claim this, I am signing this object:

@chrismatheson
chrismatheson / blah.js
Created July 4, 2018 13:49
Fully typecheked JS with TS lib thing
/** "TypeDef" lib */
function Obj<T>(a: T): T {
return undefined;
}
function Str(): string {
return undefined;
}
function Optional<T>(a: T) {
@chrismatheson
chrismatheson / dreamcode.html
Last active January 22, 2016 12:52
Dream code, that can be pre-processed by a static site get and produce the right stuff
<html>
<head>
<link rel="import" href="/path/to/imports/site-header.html">
<style type="test/less">
@base: #f938ab;
@import "theme.less";
form {
background-color: @base;
}
@chrismatheson
chrismatheson / keybase.md
Created September 22, 2015 15:41
keybase.md

Keybase proof

I hereby claim:

  • I am chrismatheson on github.
  • I am chrismatheson (https://keybase.io/chrismatheson) on keybase.
  • I have a public key whose fingerprint is 049E 9AC4 D33B 0988 7B35 61C0 D928 9505 E2BE A4D4

To claim this, I am signing this object:

Verifying I am +chrismatheson on my passcard. https://onename.com/chrismatheson
var ben, chris, dan, eddie;
ben = [blue, green, yellow, purple, red];
chris = [blue, green, black, white, indigo];
dan = [orange, violet, brown, pink, turquoise];
eddie = [pink, green, sand, grey, crap];
desired results
function findCurrentScript() {
var results = $('script').map(function (i, elm) {
var src = $(elm).attr('src') || '';
return /iv-widget\.js/.test(src) ? src : undefined;
}).get();
switch (results.length) {
case 0:
@chrismatheson
chrismatheson / gulp.js
Created March 27, 2014 09:21
Gulp version things
function version(prefix) {
'use strict';
var stream = require('stream').Transform({objectMode: true}),
path = require('path');
stream._transform = function(chunk, enc, next) {
if (chunk.isNull()) {
this.push(chunk);
return next();
@chrismatheson
chrismatheson / gulp.js
Last active August 29, 2015 13:57
Azure deploy before refactor
gulp.task('deploy-staging', ['timestamp', 'build'], function(){
'use strict';
var build_sha = process.env.build_sha || '',
blobService = azure.createBlobService(),
container = 'staging',
stagingCssNames = {},
stagingCssLocations = _.map(build.css, function(css){
stagingCssNames[css] = 'static/' + build_sha + css;
return 'dist/static/' + css;
@chrismatheson
chrismatheson / gulp.js
Last active August 29, 2015 13:57
Azure deploy after refactor
function azureUpload(opts) {
var blobService = azure.createBlobService(),
containerName = opts.container;
console.log('setting container: ' + containerName);
blobService.createContainerIfNotExists(containerName, {publicAccessLevel : 'blob'}, function(error){
});
//create a writeable stream