This file contains hidden or 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 | |
require "base64" | |
message = "HG: Enter commit message. Lines beginning with 'HG:' are removed." | |
data = STDIN.read | |
data.gsub!(/^HG: .+\n/, '') if data.include? message | |
%x[open http://hashify.me/#{Base64.encode64(data).gsub(/\n/, '')}] | |
=begin | |
+-[ COMMAND SETTINGS ]------------+ |
This file contains hidden or 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
<?xml version="1.0" encoding="UTF-8"?> | |
<seestyle> | |
<mode id="SEEMode.Javascript"> | |
<style id="_Default" | |
color="#657b83" font-style="normal" font-weight="normal" background-color="#fdf6e3" /> | |
<style id="/Javascript/Keywords" | |
color="#859900" font-style="normal" font-weight="normal" /> | |
<style id="/Javascript/this" | |
color="#586e75" font-style="normal" font-weight="normal" /> | |
<style id="/Javascript/Numbers" |
This file contains hidden or 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
worker_processes 1; | |
events { | |
worker_connections 1024; | |
} | |
http { | |
include mime.types; | |
default_type application/octet-stream; |
This file contains hidden or 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 | |
# Publish documents on the internets! | |
# ----------------------------------- | |
# Copyright (c) 2011, David Chambers. | |
# * * * * * * * * * * * * * * * * * * | |
require 'base64' | |
require 'net/http' |
This file contains hidden or 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
to_hash = (pairs) -> | |
hash = {} | |
hash[key] = value for [key, value] in pairs | |
hash | |
# usage: | |
to_hash ([n, n * n] for n in [0..5]) # {0:0, 1:1, 2:4, 3:9, 4:16, 5:25} |
This file contains hidden or 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
escapeRegExpChars = (string) -> | |
# Copied from https://github.com/slevithan/XRegExp. | |
string.replace /[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&' | |
deconstructRegExp = (regexp) -> | |
/// ^/(.+)[/]([gimy]*)$ ///.exec regexp | |
# Create a pattern like the one provided, but with a start of string | |
# anchor: | |
# |
This file contains hidden or 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
Action | |
------------------------------------ | |
Release Publish Configure | |
Project name on GitHub on npm Travis CI | |
------------------------------------------------------------ | |
airwaves (*) (*) (*) | |
an.hour.ago (*) (*) (*) | |
Base64.js (*) (*) (*) | |
CANON (*) (*) (*) | |
doctest (*) (*) ( ) |
This file contains hidden or 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 python | |
import subprocess | |
import sys | |
args = sys.argv[1:] | |
if args in (['-h'], ['--help'], []): | |
print ''' |
This file contains hidden or 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
(req, res) -> | |
# Attach language codes to request object. | |
h = req.headers['accept-language'] | |
req.languages = h and (/[^\s;-]+/.exec(l)[0] for l in h.split ',') or [] |
This file contains hidden or 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
# Problem: Determine all the paths for a given node. | |
# | |
# A | |
# / \ | |
# / \ | |
# B C | |
# / \ \ | |
# / \ \ | |
# C D D | |
# \ |
OlderNewer