Skip to content

Instantly share code, notes, and snippets.

View catsby's full-sized avatar
🏠
Working from home

Clint catsby

🏠
Working from home
View GitHub Profile
@catsby
catsby / shards.yml
Created October 10, 2013 19:00 — forked from eprothro/shards.yml
<%
require 'cgi'
require 'uri'
def attribute(name, value, force_string = false)
if value
value_string =
if force_string
'"' + value + '"'
else
@catsby
catsby / _output
Last active October 23, 2016 03:51
Requiring relatively with Elixir
$ ls
other_thing.exs
thing.exs
$ elixir thing.exs
calling other
other thing!
hooray!
@catsby
catsby / wat.rb
Created June 28, 2013 19:58
ruby wat
$ irb
>> a
NameError: undefined local variable or method `a' for main:Object
from (irb):1
from /Users/clint/.rbenv/versions/1.9.3-p429/bin/irb:12:in `<main>'
>> exit
$ irb
>> if false; a = 1; end
nil
>> a
@catsby
catsby / gist:5868627
Created June 26, 2013 15:53
Link headers for pagination
HTTP/1.1 200 OK
Server: GitHub.com
Date: Wed, 26 Jun 2013 15:52:57 GMT
Content-Type: application/json; charset=utf-8
Connection: keep-alive
Status: 200 OK
X-RateLimit-Limit: 60
X-RateLimit-Remaining: 57
Vary: Accept
Cache-Control: public, max-age=60, s-maxage=60
@catsby
catsby / ascii
Created November 13, 2012 17:14
ASCII art for science
(ノ^_^)ノ
(╯°□°)╯︵ ┻━┻
(ノಠ益ಠ)ノ彡┻━┻
(╯°□°)╯︵ sıɥʇ
┬─┬ノ( º _ ºノ)
(╯°□°)╯︵ ╯(.□.╯)
(╯°□°)╯/(.□. \)
ಠ_ಠ
ಠ益ಠ
¯\_(ツ)_/¯
@catsby
catsby / .configure --show
Created July 23, 2012 18:38
Rbx configure, install install
Checking gcc: found
Checking g++: found
Checking bison: found
Using the following configuration to build
------------------------------------------
module Rubinius
BUILD_CONFIG = {
:command_line => "--prefix=/Users/clint/.rbenv/versions/rbx-2.0.0-dev --with-lib-dir=/Users/clint/Developer/lib --gemsdir=/Users/clint/.rbenv/versions/rbx-2.0.0-dev/gems --default-version=19 --enable-version=19",
:which_ruby => :ruby,
$❯ curl http://github.com/api/v2/json/issues/show/ctshryock/githubnotifier/23
{
"issue": {
"gravatar_id": "6baef51125abe57a170be717454f7631",
"position": 1.0,
"number": 23,
"votes": 0,
"created_at": "2012/05/22 10:35:02 -0700",
"comments": 0,
"body": "Github only supports API v3 as of May 1st, 2012 (https://github.com/blog/1090-github-api-moving-on). The new API does not use API tokens, and as far as I can tell, this app no longer works as expected.",
octokit git:master ❯ curl http://github.com/api/v2/json/issues/show/pengwynn/octokit/23 | jsonpretty
{
"issue": {
"gravatar_id": "dfb3948650131e4f0385c3328187cfca",
"position": 20.0,
"number": 23,
"votes": 0,
"created_at": "2011/04/29 13:17:06 -0700",
"comments": 0,
"body": "API v3 has extended/updated support for Labels, need to upgrade issues.rb to support the new url.\r\n\r\nNotes:\r\n\r\n- Labels can now have colors, sent as 6 character hex code, without a leading #\r\n\r\nAdditions:\r\n\r\n- List Labels on a specific Issue\r\n- Add Labels to an Issue\r\n- Remove a Labile from an Issue\r\n- Replace all Labels for an Issue\r\n- Remove all Labels from an Issue\r\n- Get Labels for every Issue in a Milestone\r\n\r\n\r\n\r\n[OLD documentation][1] &mdash; [NEW documentation][2]\r\n\r\n\r\n\r\n\r\n[1]: http://develop.github.com/p/issues.html\r\n[2]: http://developer.github.com/v3/issues/\r\n",
@catsby
catsby / py.py
Created May 15, 2012 19:25 — forked from bryanhelmig/py.py
queue examples
# bad way
def new_message(request):
user = get_user_or_404(request)
message = request.POST.get('message', None)
if not message:
raise Http404
user.save_new_message(message)
@catsby
catsby / message
Created May 11, 2012 14:58
test upload
Goodbye, world