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
document.onclick = function(event) { | |
event = event || window.event; | |
var target = event.target || event.srcElement, | |
targetElement = target.tagName.toLowerCase(); | |
if (targetElement == "a") { | |
var href = target.getAttribute("href"), | |
urlHost = document.domain.replace(/^www\./i,""); | |
var urlPattern = "^(?:https?:)?\/\/(?:(?:www)\.)?" + urlHost + "\/?"; |
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/evn python2.6 | |
# Shell script for rotating/archiving nginx logs | |
import os | |
from datetime import datetime | |
cwd = os.getcwd() | |
date = datetime.now().strftime("%Y-%m-%d") |
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 | |
curl -k --user USERNAME:PASSWORD -o delicious.xml -O 'https://api.del.icio.us/v1/posts/all' |
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
//Set initial slide | |
changeSlide(currentSlide); | |
//Add this line to make the slides auto-change | |
autoSlide = setInterval(function() { nextSlide() }, 30000); |
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 lang="en" class="no-js"> | |
<head> | |
<meta charset="utf-8" /> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1" /> | |
<script>(function(H){H.className=H.className.replace(/\bno-js\b/,'js')})(document.documentElement)</script> | |
<!--[if lt IE 9]><script src="/_assets/js/html5-shiv.js"></script><![endif]--> | |
<link rel="stylesheet" href="/_assets/css/styles.css" media="all" /> | |
<!--[if IE]><link rel="stylesheet" href="/_assets/css/ie.css" media="all" /><![endif]--> |
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
I, Jason Huggins, the author of the work "CoffeeScript Web Server" (2010), irrevocably renounce | |
all current and future legal rights to the work in any medium whatsoever. | |
I stand behind the merit of the work, but disclaim all liability for it under law. | |
I encourage you, the audience, to share, copy, distribute, perform, remix, mash up, interpret, | |
excerpt, translate, and otherwise enjoy and use the work as you will. | |
I request that you acknowledge my authorship. |
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 app = (function(testMode) { | |
//Private methods | |
var method1 = function() {}; | |
var method2 = function() {}; | |
//Public methods | |
var method3 = function() {}; | |
var method4 = function() {}; | |
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
# CoffeeScript and Stylus watch/build cakefile | |
{spawn, exec} = require 'child_process' | |
task 'assets:watch', 'Watch source files and build JS & CSS', (options) -> | |
runCommand = (name, args...) -> | |
proc = spawn name, args | |
proc.stderr.on 'data', (buffer) -> console.log buffer.toString() | |
proc.stdout.on 'data', (buffer) -> console.log buffer.toString() | |
proc.on 'exit', (status) -> process.exit(1) if status isnt 0 | |