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
// read-only registry API server | |
// TODO: | |
// * directly read from the .tar file (will break martini.Static) | |
// * UX friendly error handling | |
package main | |
import ( | |
"encoding/json" |
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 -e | |
redis_hostport=$(cat /s/etc/kato/redis_uri | cut -d"/" -f3) | |
redis_host=$(echo $redis_hostport | cut -d: -f1) | |
redis_port=$(echo $redis_hostport | cut -d: -f2) | |
redis_cli="redis-cli -h ${redis_host} -p ${redis_port}" | |
user=$(whoami) | |
endpoint=$(timeout 0.1 $redis_cli get cluster | json endpoint) | |
ipaddr=$(timeout 0.1 /sbin/ifconfig eth0 | grep "inet addr" | awk -F: '{print $2}' | awk '{print $1}') | |
roles=$(timeout 0.1 $redis_cli get node | json "[\"${ipaddr}\"]" | json roles | json -ak | paste -sd "," -) |
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
(defun jekyll-serve () | |
(interactive) | |
(let* ((default-directory | |
(if (string-match "_posts/$" default-directory) | |
(directory-parent default-directory) | |
default-directory)) | |
(buffer (if (get-buffer "*jekyll*") | |
(switch-to-buffer "*jekyll*") | |
(ansi-term "/bin/bash" "jekyll"))) | |
(proc (get-buffer-process buffer))) |
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 runhaskell | |
module Main where | |
data Coin = Quarter | Loonie deriving (Eq, Show) | |
type Cents = Int | |
cents :: Coin -> Cents | |
cents Quarter = 25 | |
cents Loonie = 100 |
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
import os, sys | |
def hello(): | |
print "Hello World!" | |
if __name__ == "__main__": | |
hello() |
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
/* | |
Ubiquity Command: download-files [regexp pattern] to [folder] | |
Author: Duane Johnson | |
Email: duane.johnson@gmail.com | |
Description: Downloads files matching the regular expression pattern to a folder. | |
See: http://github.com/canadaduane/ubiquity-download-files | |
*/ | |
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
while true; do | |
notify-send -t 20000 "Take a break?" "Just look away and blink your eyes" | |
sleep 1200; | |
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
srid@homeless:~/code/gnusim8085$ git branch; git svn info | |
master | |
* ui-file-management | |
Path: . | |
URL: https://gnusim8085.svn.sourceforge.net/svnroot/gnusim8085/tags/1.3.5 | |
Repository Root: https://gnusim8085.svn.sourceforge.net/svnroot/gnusim8085 | |
Repository UUID: c0c784df-5f15-0410-a540-c3e77be2c7b8 | |
Revision: 136 | |
Node Kind: directory | |
Schedule: normal |
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
def test_typical_usecase(): | |
"""Test the typical use case, which is to - | |
1) update 2) search 3) install 4) remove | |
.. and 5) import | |
""" | |
packages = packages_small_list | |
c, repo_root_url = prepare_client(packages) | |
c.do_update(None, None, repo_root_url) |
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
# an example of ordered test runs using yield | |
def test_typical_usecase(): | |
"""Test the typical use case, which is to - | |
1) update 2) search 3) install 4) remove | |
.. and 5) import | |
""" | |
c, repo_root_url = prepare_client(packages_small_list) | |
OlderNewer