This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// [B](f: (A) ⇒ [B]): [B] ; Although the types in the arrays aren't strict (: | |
Array.prototype.flatMap = function(lambda) { | |
return Array.prototype.concat.apply([], this.map(lambda)); | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Functional Helper: When lambda returns an array, compose concat and map to return a flattened result. | |
// See https://gist.github.com/samgiles/762ee337dff48623e729 for an example | |
Array.prototype.flatMap = function(lambda) { | |
return Array.prototype.concat.apply([], this.map(lambda)); | |
}; | |
// Mock, imagine this is some function that maps a modernizr test name to the polyfill.io nomenclature, if it doesn't map, | |
// it must return the name as is. Must always be an array. | |
function getListOfPolyFillsForModernizrTest(name) { | |
var mock = { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo: false | |
language: node_js | |
node_js: | |
- "0.10" | |
before_install: | |
- npm install -g Financial-Times/origami-build-tools#node-0.10 | |
- obt install | |
script: | |
- obt test | |
- obt verify |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>DOM Recycler</title> | |
<style> | |
/* Styles not relevant to scrolling (just to make the demo look neat and tidy) */ | |
body { font-family: sans-serif; -webkit-text-size-adjust: 100% } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
var resolvedPolyfills = {}; | |
polyfills.forEach(function(polyfill) { | |
resolvers.forEach(function(resolver) { | |
resolver(polyfill).forEach(function(targetPolyfill) { | |
resolvedPolyfills[targetPolyfill.name] = targetPolyfill | |
}) | |
}) | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Not global: | |
npm ls -p --depth=0 | awk -F/node_modules/ '{print $2}' | grep -vE '^(npm)$' | xargs npm rm | |
# Global: | |
npm ls -gp --depth=0 | awk -F/node_modules/ '{print $2}' | grep -vE '^(npm)$' | xargs npm -g rm |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Set up key for github | |
make sure brew is installed | |
make sure git is installed with brew | |
(Sourcetree issues..) Use HTTPS (Auth issues are just too much) Github for Mac | |
git clone at the command line? | |
try `sudo gem install ruby` if failed: | |
rvm install ruby |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"families": [{ | |
"description": "Micro instances are a low-cost instance option, providing a small amount of CPU resources. They are suited for lower throughput applications, and websites that require additional compute cycles periodically, but are not appropriate for applications that require sustained CPU performance. Popular uses for micro instances include low traffic websites or blogs, small administrative applications, bastion hosts, and free trials to explore EC2 functionality.", | |
"name": "Micro instances", | |
"types": [{ | |
"architectures": ["x86_64", "i386"], | |
"cpu": { | |
"cores": 1, | |
"units": "Variable" | |
}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import argparse | |
import urllib2 | |
import json | |
import sys | |
NAGIOS_OK = 0 | |
NAGIOS_WARN = 1 | |
NAGIOS_CRIT = 2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
The MIT License (MIT) | |
Copyright (c) 2014 Samuel Giles | |
Permission is hereby granted, free of charge, to any person obtaining a copy | |
of this software and associated documentation files (the "Software"), to deal | |
in the Software without restriction, including without limitation the rights | |
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
copies of the Software, and to permit persons to whom the Software is | |
furnished to do so, subject to the following conditions: |