Skip to content

Instantly share code, notes, and snippets.

module['exports'] = function accessRequestData (hook) {
var AWS = require('aws-sdk')
var res = hook.res
AWS.config.update({
accessKeyId: hook.env.accessKeyId,
secretAccessKey: hook.env.secretAccessKey,
region: hook.env.region
})
module['exports'] = function pingtMtWellington (hook) {
var req = require('request')
var store = hook.datastore
req.head('http://www.rosebay.tased.edu.au/webcam/large.jpg', function (err, res, body) {
if (err) {
console.log(err.messsage)
return hook.res.end(err.messsage)
}
if (!res.headers['last-modified']) {
@joshgillies
joshgillies / README.md
Last active August 29, 2015 14:20 — forked from mbostock/.block

A variant of the Zoom to Bounding Box example that uses zoom transitions to smoothly interpolate between different views. This example also allows you to freely pan and zoom with the mouse (or touch).

@joshgillies
joshgillies / keybase.md
Created April 29, 2014 12:26
rockin' keybase style

Keybase proof

I hereby claim:

  • I am joshgillies on github.
  • I am joshgillies (https://keybase.io/joshgillies) on keybase.
  • I have a public key whose fingerprint is D1A4 7689 921F A140 140D D25E 4A5F 02C5 BA3C 4172

To claim this, I am signing this object:

@joshgillies
joshgillies / pw-hax.js
Created February 27, 2014 04:18
some things for things
var json = {
data: ['a','bunch','of','things']
};
var otherData = {
things: [],
madness: {}
};
json.data.forEach(function(data,index,array){
@joshgillies
joshgillies / .vimrc
Created June 13, 2013 07:05
dat vim
" Use Vim settings, rather then Vi settings (much better!).
" This must be first, because it changes other options as a side effect.
set nocompatible
" TODO: this may not be in the correct place. It is intended to allow
" overriding <Leader>.
" source ~/.vimrc.before if it exists.
if filereadable(expand("~/.vimrc.before"))
source ~/.vimrc.before
endif " ================ General Config ====================
@joshgillies
joshgillies / hax.js
Created November 30, 2012 05:21
Link bait hax0r. Pulled from a compromised FTP server recently.
ww = window;
try {
ww.document.body = ww.document.body
} catch(dgsgsdg) {
zxc = 1;
}
try {
if(ww.document) window["doc" + "ument"]["body"] = ww.document
} catch(bawetawe) {
if(ww.document) {
@joshgillies
joshgillies / id-v-class.md
Created November 22, 2012 00:00
In defence of... I dunno, smart CSS?

Some notes around the article I've just read from JZ; http://www.zeldman.com/2012/11/21/in-defense-of-descendant-selectors-and-id-elements/

Whilst OOCSS is the new hotness (or at least was a few years ago), I can faithfully agree with the notion of every element in your mark-up DOES NOT require a class... In fact use classes as a way to describe your mark-up where a descriptive/semantic tag ins't available.

By the same token, the use of an ID where appropriate is totally fine, as JZ

for instance with ID's seeing something like this in CSS is completely wrong:

#paraInsideAside {
@joshgillies
joshgillies / callback.js
Created July 20, 2012 04:07
Fun with JS callbacks!
// getting my head around callbacks, would like to take this further. Maybe another time.
// See this code live: http://jsconsole.com/?function%20testMe(%20a%2C%20b%2C%20c%2C%20callback%20)%20%7B%0A%20%20var%20test%20%3D%20a%2C%0A%20%20%20%20%20%20test2%20%3D%20b%2C%0A%20%20%20%20%20%20test3%20%3D%20c%3B%0A%20%20console.log(test%20%2B%20%22%20%22%20%2B%20test2%20%2B%20%22%20%22%20%2B%20test3)%3B%0A%20%20test2%20%3D%20b%20%2B%207%3B%0A%20%20return%20callback(%20test%2C%20test2%2C%20test3%20)%3B%0A%7D%0A%0Afunction%20testThis(%20callback%20)%20%7B%0A%20%20console.log(%22helloworld%22)%3B%0A%20%20console.log(typeof%20callback)%3B%0A%20%20(typeof%20callback%20%3D%3D%3D%20'number'%20%3F%20%20callback%20%3D%20callback%20%2B%207%20%3A%20callback)%3B%0A%20%20return%20callback%3B%0A%7D%0A%0AtestThis(%20testMe(%20%22string%22%2C%2020%2C%20false%2C%20function%20()%20%7B%0A%20%20return%20test2%3B%0A%7D))%3B
function testMe( a, b, c, callback ) {
var test = a,
test2 = b,
test3 = c;
console.log(test + " "
@joshgillies
joshgillies / gist:1990873
Created March 7, 2012 04:04
WCAG AA document.write()
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
<script>window.jQuery || document.write('<script src="js/libs/jquery-1.7.1.min.js"><\/script>')</script>