- Repo: https://github.com/insin/react-hn
- Live: https://react-hn.appspot.com (Version with forced offline caching at https://react-hn-rest.appspot.com)
- Detailed breakdown: https://gist.github.com/addyosmani/6e25174135f4f0095de77f07ecf068df
- Lighthouse: First meaningful paint (target value: 1,000ms) 100 (382.25ms)
- Lightouse: Speed Index (target value: 1,000) 98 (1330)
- Preact HN - a Preact version of this app is also available
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
gifify() { | |
if [[ -n "$1" ]]; then | |
if [[ $2 == '--good' ]]; then | |
ffmpeg -i $1 -r 10 -vcodec png out-static-%05d.png | |
time convert -verbose +dither -layers Optimize -resize 600x600\> out-static*.png GIF:- | gifsicle --colors 128 --delay=5 --loop --optimize=3 --multifile - > $1.gif | |
rm out-static*.png | |
else | |
ffmpeg -i $1 -s 600x400 -pix_fmt rgb24 -r 10 -f gif - | gifsicle --optimize=3 --delay=3 > $1.gif | |
fi | |
else |
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
#!/bin/sh -e | |
# | |
# WigWag LLC | |
# License: this script is public domain | |
# | |
# This will setup a shell to cross compile node.js (node 0.8 working for us) using cross tools | |
# Example uses a Freescale tool chain... | |
# Adjust vars below to your taste and good luck |
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
/** | |
* Implementation of an SortedMap using Left-leaning Red-Black Tree | |
* | |
* Original paper on Left-leaning Red-Black Trees: | |
* - http://www.cs.princeton.edu/~rs/talks/LLRB/LLRB.pdf | |
* | |
* Invariant 1: No red node has a red child | |
* Invariant 2: Every leaf path has the same number of black nodes | |
* Invariant 3: Only the left child can be red (left leaning) | |
*/ |
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
# -*- mode: ruby -*- | |
# vi: set ft=ruby : | |
Vagrant.configure("2") do |config| | |
# All Vagrant configuration is done here. The most common configuration | |
# options are documented and commented below. For a complete reference, | |
# please see the online documentation at vagrantup.com. | |
# Every Vagrant virtual environment requires a box to build off of. | |
config.vm.box = "ubuntu1204_64" |
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
(function (window, document, $, undefined) { | |
if (!$.Deferred) throw 'jQuery 1.5 is required to use the jQuery.oauth script!'; | |
function require(name, url) { | |
if (window[name] === undefined) | |
return $.ajax({ type: 'GET', cache: true, dataType: 'script', url: url }); | |
} | |
$.oauth = function (options) { | |
var d = $.Deferred(); |
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> | |
<meta charset="utf-8"> | |
<meta name="viewport" content="width=device-width"> | |
<link rel="manifest" href="https://jsbin-user-assets.s3.amazonaws.com/kinlan/manifest.json"> | |
<title>iOS Manifest Polyfill</title> | |
</head> | |
<body> |
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
angular.module('myApp', ['ngRoute']) | |
.provider('Weather', function() { | |
var apiKey = ""; | |
this.getUrl = function(type, ext) { | |
return "http://api.wunderground.com/api/" + | |
this.apiKey + "/" + type + "/q/" + | |
ext + '.json'; | |
}; |
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
/** | |
* Module dependencies. | |
*/ | |
var express = require('express') | |
// , routes = require('./routes') | |
// , user = require('./routes/user') | |
, http = require('http') | |
, path = require('path'); |