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 | |
#------------------------------------------------------------------------------- | |
# draw-histogram - generates an ASCII-art histogram (bar chart) from input data. | |
#------------------------------------------------------------------------------- | |
# Expects a series of lines of the form `<category-name> <count>` to passed | |
# via stdin. | |
# | |
# Generates a table the looks something like the following: | |
# | |
# +-------+----+ |
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
// | |
// Run this graph definition through the dot rendering engine. | |
// | |
// E.g.: | |
// dot -Tpng pentagonal-graph-for-reinh.gv -o image.png | |
// or | |
// dot -Txlib pentagonal-graph-for-reinh.gv | |
// | |
// Also note that if you don't care about the exact orientation, | |
// the "out of the box" rendering with the circo engine is pretty |
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 | |
# This is an example of a (bash) shell script that uses the forever module ([1]) | |
# to start and stop a CoffeeScript application as if it were a service. | |
# | |
# [1] <https://github.com/nodejitsu/forever> | |
# ASSUMPTIONS | |
################################################################################ | |
# 1) You've got a CoffeeScript program you want to run via `forever`. |
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"> | |
{+html_head} | |
<head> | |
<meta charset="utf-8"> | |
{+html_head_title}<title>{+page_title}PAGE TITLE{/page_title}</title>{/html_head_title} |
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
digraph fig2 { | |
splines=line # makes edges straight rather than curved | |
ranksep=0.2 # controls distance between rows | |
# create a record-type node representing the row of numbers | |
# (the `<x>` bit declares a port we can point edges to) | |
n [shape=record label="{<a>58}|{<b>82}|{<c>16}|{<d>85}|{<e>65}|{<f>5}|{<g>67}|{<h>26}"] | |
# create some dummy rows, each with one false node per element in n | |
node [shape=point height=0 style=invis]; |
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's a little CoffeeScript routine that will recursively | |
# read the file-system, generating an object that represents | |
# a directory tree. | |
# The returned object will contain the following attributes: | |
# | |
# * `file` - the basename of the file. | |
# * `dir` - the directory containing the file. | |
# * `types` - an array containing zero or more of | |
# "File", "Directory", "SymbolicLink", "BlockDevice", |
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 Encoder = require('./lib/encoder.js').Encoder; | |
var encoder = new Encoder('entity'); | |
console.log(''); | |
console.log('Generally, when no characters need to be encoded,'); | |
console.log('htmlEncode() returns input string.'); | |
console.log(''); | |
console.log('For example,'); | |
console.log(' encoder.htmlEncode("Foo")'); | |
console.log('yields'); |
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 | |
# Uses a PID file to add daemon-like behavior to an arbitrary program. | |
################################################################################ | |
usage() { | |
echo "Usage: `basename $0` PROGRAM {start|stop|restart|force-stop|force-restart|status} [PIDFILE|PID]" >&2 | |
echo "Where: PROGRAM is an executable file." >&2 | |
echo " PIDFILE is the file that contains (or will contain) the PID." >&2 | |
echo " PID is a process id to use in place of a PIDFILE." >&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
#!/usr/bin/env ruby | |
# wiki-tag-indexer - Processes a directory of Gollum wiki files updating | |
# special "tag" pages with a list of pages that contain that tag. | |
#=============================================================================== | |
# QUICK-START INSTRUCTIONS | |
# ------------------------ | |
# | |
# 0. If you haven't already, clone the git repository containing your wiki. | |
# E.g., if you're on GitHub, use something like: |
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 | |
# A simple script to backup an organization's GitHub repositories. | |
#------------------------------------------------------------------------------- | |
# NOTES: | |
#------------------------------------------------------------------------------- | |
# * Under the heading "CONFIG" below you'll find a number of configuration | |
# parameters that must be personalized for your GitHub account and org. | |
# Replace the `<CHANGE-ME>` strings with the value described in the comments | |
# (or overwrite those values at run-time by providing environment variables). |
NewerOlder