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
# # cd into matching gem directory | |
# cdgem() { | |
# local gempath=$(gem env gemdir)/gems | |
# if [[ $1 == "" ]]; then | |
# cd $gempath | |
# return | |
# fi | |
# | |
# local gem=$(ls $gempath | g $1 | sort | tail -1) | |
# if [[ $gem != "" ]]; then |
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 -l | |
shopt -s nullglob | |
enqueue() { | |
for rev; do | |
echo -n "$rev" > "$(mktemp "$queuedir/$(date +%s).XXXXXX")" | |
done | |
} |
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/sh | |
# ssh-wrapper :: helper script for git to run custom ssh commands | |
# | |
# example usage: | |
# GIT_SSH=ssh-wrapper GIT_SSH_KEY=my_private_key.rsa git ... | |
if [ -s "$GIT_SSH_KEY" ]; then | |
exec ssh -i "$GIT_SSH_KEY" "$@" | |
else |
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 python | |
def HS11DIVS(a, b, x, l, r): | |
if a % x: | |
a += x - a % x | |
current, matches = a, 0 | |
while current <= b: | |
current_sum = sum(int(str_digit) for str_digit in str(current)) | |
if l <= current_sum <= r: |
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
<html> | |
<head> | |
<script language="JavaScript"> | |
//Analog clock script- By Kurt (kurt.grigg@virgin.net) | |
//Script featured on Dynamic Drive | |
//Visit http://www.dynamicdrive.com for this script and more | |
fCol='444444'; //face colour. | |
sCol='FF0000'; //seconds colour. |
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 | |
endpoint=https://stream.twitter.com/1/statuses/filter.json | |
proxy=<your-proxy> | |
auth=<your-username>:<your-password> | |
data=track=<your-comma-separated-keywords> | |
while true; do | |
tmpdir=$(mktemp -d --tmpdir=${1:-$PWD}) || exit |
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
// ==UserScript== | |
// @match <target-url> | |
// ==/UserScript== | |
var interval = 60; // seconds | |
var links = document.links; | |
for (var i=0; i<links.length; i++) { | |
if (links[i].textContent && links[i].textContent.trim() == "Check Messages") { | |
var cm_link = links[i]; |
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
(defn merge-step [seq1 seq2] | |
(let [head1 (first seq1) | |
head2 (first seq2)] | |
(cond | |
(nil? head1) seq2 | |
(nil? head2) seq1 | |
:else (if (< head1 head2) | |
(cons head1 (lazy-seq (merge-step (rest seq1) seq2))) | |
(cons head2 (lazy-seq (merge-step seq1 (rest seq2)))))))) |
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
(defn merge-step [seq1 seq2] | |
(let [head1 (first seq1) | |
head2 (first seq2)] | |
(cond | |
(nil? head1) seq2 | |
(nil? head2) seq1 | |
:else (if (< head1 head2) | |
(cons head1 (merge-step (rest seq1) seq2)) | |
(cons head2 (merge-step seq1 (rest seq2))))))) |
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
(defn merge-step | |
([seq1 seq2] | |
(merge-step [] seq1 seq2)) | |
([result seq1 seq2] | |
(let [head1 (first seq1) | |
head2 (first seq2)] | |
(cond | |
(nil? head1) (concat result seq2) | |
(nil? head2) (concat result seq1) | |
:else (if (< head1 head2) |
OlderNewer