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
'use strict'; | |
// Script to workaround discrepancies in s3 <=> os file and directory names. | |
// It allows you to host your static website on s3 without trailing slashes. | |
// e.g. example.com/products and example.com/products/mugs | |
if (!process.argv[2]) throw new Error('Must pass bucket as argument'); | |
var options = { | |
target: '.', |
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
process.title = 'node http-proxy'; | |
var CONCURRENCY = 250; | |
var assert = require('assert') | |
, crypto = require('crypto') | |
, http = require('http'); | |
http.globalAgent.maxSockets = Infinity; |
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
process.title = 'node http-proxy'; | |
var CONCURRENCY = 250; | |
var assert = require('assert') | |
, crypto = require('crypto') | |
, http = require('http'); | |
http.globalAgent.maxSockets = Infinity; |
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
// Deps on jquery | |
(function(container) { | |
var viewportWidth = $(container).width(); | |
console.group('Overflow Check'); | |
console.info('Container Width: %s', viewportWidth); | |
$('*').each(function() { | |
var $this = $(this); | |
var elWidth = $this.outerWidth(true); | |
if (elWidth > viewportWidth) { | |
console.warn('Overflow by %spx!', elWidth - viewportWidth, loggingVars, this); |
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
// This loads large-ish new line separated JSON files into memory. If you need truly large file support | |
// and getting errors, you might want to google nodejs v8 heap limit or something. | |
// I believe it's the --max-old-space-size option in particular. | |
// Another script I wrote generated the JSON files in this | |
// format, so this script matches the format. | |
// File Lines: | |
// 1. [ | |
// 2. null | |
// 3. , { some: 'object', data: 'here' } |
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 crypto = require('crypto'); | |
var ALGO = 'sha256'; | |
function hashValue(val) { | |
var hash = crypto.createHash(ALGO) | |
, target; | |
switch (toString.call(val)) { | |
case '[object Object]': | |
target = hashObject(val); |
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
// https://github.com/cmawhorter/hmmac/issues/10 | |
var app = require('express')(); | |
var Hmmac = require('hmmac'); | |
var AWS = require('aws-sdk'); | |
var accessKeyId = 's3box'; | |
var secretAccessKey = 's3box'; | |
var hmmac = new Hmmac({ |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 sh | |
# Expects this dir structure: | |
# libs (tip: symlink these) | |
# crosswalk_x86 | |
# crosswalk_arm | |
# src | |
# client | |
# ... | |
# hooks |
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
# http://stackoverflow.com/a/12269225/670023 | |
# Binds to localhost | |
alias H="echo 'Serving HTTP on 127.0.0.1 port 8000 ...'; python -c 'import BaseHTTPServer as bhs, SimpleHTTPServer as shs; bhs.HTTPServer((\"127.0.0.1\", 8000), shs.SimpleHTTPRequestHandler).serve_forever()'" |