$ sudo apt-get update
$ sudo apt-get install libcairo2-dev libjpeg8-dev libpango1.0-dev libgif-dev build-essential g++
Important: libjpeg8-dev
is required rather than just libjpeg-dev
$ sudo npm install canvas
<!DOCTYPE html> | |
<HTML> | |
<head> | |
<title>Original Title</title> | |
<script> | |
var originalTitle = document.title; | |
var altTitle = 'Alternative Title'; | |
var onBlurEvents = window.onblur; | |
var onFocusEvents = window.onfocus; |
/** | |
* Levenshtein edit distance calculator | |
* Usage: levenstein <string> <string> | |
* | |
* To compile: | |
* sudo xcode-select -switch /Applications/Xcode6-Beta.app/Contents/Developer | |
* xcrun swift -sdk $(xcrun --show-sdk-path --sdk macosx) levenshtein.swift | |
*/ | |
import Foundation |
func strongestContrast(color: UIColor) -> UIColor { | |
let colorRef: CGColorRef = color.CGColor | |
let components = CGColorGetComponents(colorRef) | |
let relativeLuminance = 1 - (0.2126 * components[0] + 0.7152 * components[1] + 0.0722 * components[2]) | |
if (relativeLuminance >= 0.5) { | |
return UIColor.whiteColor() | |
} else { | |
return UIColor.blackColor() |
// Happy Numbers | |
// info: http://en.wikipedia.org/wiki/Happy_number | |
// by Florian Nagel | |
// floriannagel.net | |
import Foundation | |
func isHappyNumber(var number: Int) -> Bool { | |
var history = [Int]() | |
=media-query($min, $max: "") | |
@if ($max == "") | |
@media (min-width: $min) | |
@content | |
@else | |
@media (min-width: $min) and (max-width: ($max - 1px)) | |
@content |
machine: | |
node: | |
version: 0.10.40 | |
pre: | |
# download if meteor isn't already installed in the cache | |
- meteor || curl https://install.meteor.com | /bin/sh | |
post: | |
- meteor --version | |
checkout: |
module.exports = { | |
config: { | |
// default font size in pixels for all tabs | |
fontSize: 16, | |
// font family with optional fallbacks | |
fontFamily: '"Inconsolata for Powerline", Menlo, "DejaVu Sans Mono", "Lucida Console", monospace', | |
// terminal cursor background color (hex) | |
cursorColor: '#fff', |