An introduction to curl using GitHub's API
Makes a basic GET request to the specifed URI
curl https://api.github.com/users/caspyin
#!/bin/bash | |
# | |
# downcase PATH | |
# | |
# Recursively convert all file names contained in the given directory | |
# tree (but excluding the given directory itself) to lowercase. | |
# Existing files which are named identical to new, lowercased file | |
# names will be clobbered. | |
# | |
# Author: Ross Paffett <ross@rosspaffett.com> |
require 'socket' | |
require 'timeout' | |
class MCQuery | |
MAGIC_PREFIX = "\xFE\xFD" | |
PACKET_TYPE_CHALLENGE = "\x09" | |
PACKET_TYPE_QUERY = "\x00" | |
ID = "\x00\x00\x00\x00" | |
DEFAULTS = { | |
host: "localhost", |
#!/bin/bash | |
if [ "$1" = "-h" -o "$1" = "--help" -o -z "$1" ]; then cat <<EOF | |
appify v3.0.1 for Mac OS X - http://mths.be/appify | |
Creates the simplest possible Mac app from a shell script. | |
Appify takes a shell script as its first argument: | |
`basename "$0"` my-script.sh |
> ruby slugs.rb | |
id: 1639513188 | |
enciphered output, string-escaped for your convenience: | |
"X\xD0\x97N" | |
slug: lt1krc | |
decrypted id: 1639513188 | |
the same? | |
true |
# Simple bijective function | |
# Basically encodes any integer into a base(n) string, | |
# where n is ALPHABET.length. | |
# Based on pseudocode from http://stackoverflow.com/questions/742013/how-to-code-a-url-shortener/742047#742047 | |
ALPHABET = | |
"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789".split(//) | |
# make your own alphabet using: | |
# (('a'..'z').to_a + ('A'..'Z').to_a + (0..9).to_a).shuffle.join |
#!/bin/bash | |
# | |
# create-git-repo | |
# | |
# Create and publish a Git repository so that it is able to be | |
# cloned via `git clone git@host:repo.git'. | |
# | |
# Author: Ross Paffett <ross@rosspaffett.com> | |
GIT_DATA="/var/git" # Where to store the actual git repositories |
scope :module => "Api::V2" do | |
scope :path => "api/v2" do | |
resources :users | |
end | |
end | |
scope :module => "Api::V1" do | |
scope :path => "api/v1" do | |
resources :users | |
end |
# Spoutcraft development Rake tasks | |
# Usage: rake -T | |
# | |
# These tasks assume the following folder structure: | |
# spoutcraft/ | |
# lib/ | |
# spoutcraft-api.jar A compatible SpoutcraftAPI package | |
# mcp/ Minecraft Coder Pack | |
# conf/ Symlink to ../conf | |
# lib/ Symlink to ../lib |