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/bash | |
# get download file size | |
URL=$1 | |
curl -sI "${URL}" | grep "Content-Length" | cut -d ' ' -f 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
function bindEvent(el, eventName, eventHandler) { | |
if (el.addEventListener){ | |
el.addEventListener(eventName, eventHandler, false); | |
} else if (el.attachEvent){ | |
el.attachEvent('on'+eventName, eventHandler); | |
} | |
} | |
// ... | |
bindEvent(document.getElementById('myElement'), 'click', function () { | |
alert('element clicked'); |
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
wget --recursive --domains gnupg.org --no-parent --page-requisites --html-extension --convert-links --restrict-file-names=windows --no-clobber |
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
# See: http://www.houseofding.com/2008/11/generate-a-self-signed-ssl-certificate-for-local-development-on-a-mac/ | |
# Generate a host key | |
ssh-keygen -f host.key | |
# Generate a certificate request file | |
openssl req -new -key host.key -out request.csr | |
# Create a self-signed SSL certificate using the request file. | |
openssl x509 -req -days 365 -in request.csr -signkey host.key -out server.crt |
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
Here are some contents. |
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
Here are some contents. |
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
Here are some contents. |
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
_ = require 'underscore' | |
class Set | |
constructor: (opts = {}) -> | |
@items = {} | |
@fromArray = (arr) -> | |
set = new Set() | |
for item in arr | |
set.add(item) |
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 coffee | |
argv = require('optimist') | |
.alias('s', 'selector') | |
.default('s', ':root') | |
.argv | |
JSONSelect = require('JSONSelect') | |
# eyes = require('eyes') | |
# inspect = -> eyes.inspect.apply(eyes, arguments) |
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
// inspired by https://github.com/bestiejs/lodash/blob/master/lodash.js | |
// but supports cloning custom constructor instances | |
// still need to implement Date, RegExp | |
//If Object.create isn't already defined, we just do the simple shim, without the second argument, | |
//since that's all we need here | |
var Object_create = Object.create; | |
if (typeof Object_create !== 'function') { | |
Object_create = function(o) { | |
function F() {} |
OlderNewer