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 / Running test
Created December 19, 2011 19:37
Running Jekyll tests
jekyll git:master ❯ rake test ✭
/Users/clint/.rbenv/versions/1.9.3-p0/bin/ruby -I"lib:lib:test" -I"/Users/clint/.rbenv/versions/1.9.3-p0/gemsets/jekyll/gems/rake-0.9.2.2/lib" "/Users/clint/.rbenv/versions/1.9.3-p0/gemsets/jekyll/gems/rake-0.9.2.2/lib/rake/rake_test_loader.rb" "test/**/test_*.rb"
/Users/clint/.rbenv/versions/1.9.3-p0/gemsets/jekyll/gems/maruku-0.6.0/lib/maruku/input/parse_doc.rb:22:in `<top (required)>': iconv will be deprecated in the future, use String#encode instead.
/Users/clint/.rbenv/versions/1.9.3-p0/gemsets/jekyll/gems/RedCloth-4.2.7/lib/RedCloth.rb:10: Use RbConfig instead of obsolete and deprecated Config.
Run options:
# Running tests:
................................................................................................................................
[16] pry(main)> client = Octokit::Client.new(:login => 'ctshryock', :password => '**********')
[11] pry(main)> client.issue_comments('ctshryock/octokit', 10).size
=> 4
[12] pry(main)> client.add_comment('ctshryock/octokit', 10, "here's a brand new comment")
=> {"url"=>
"https://api.github.com/repos/ctshryock/octokit/issues/comments/3768382",
"body"=>"here's a brand new comment",
"updated_at"=>"2012-02-01T22:18:32Z",
"user"=>
{"url"=>"https://api.github.com/users/ctshryock",
@catsby
catsby / examples.js
Created March 21, 2012 20:21 — forked from bryanhelmig/examples.js
EmailPie Samples
// An invalid domain.
// http://emailpie.com/v1/check?email=notreal@example.com
{
"didyoumean": null,
"errors": [
{
"message": "No MX records found for the domain.",
"severity": 7
}
@catsby
catsby / html output
Created April 18, 2012 18:50
Sinatra Social Link helper
Simple social links helper
<ul>
<li>GitHub: <a href="http://github.com/ctshryock" title="@ctshryock's Github profile">@ctshryock</a></li>
<li>Twitter: <a href="http://twitter.com/ctshryock" title="@ctshryock's Twitter profile">@ctshryock</a></li>
<li>Default (Twitter): <a href="http://twitter.com/catsby" title="@catsby's Twitter profile">@catsby</a></li>
</ul>
@catsby
catsby / message
Created May 11, 2012 14:58
test upload
Goodbye, world
@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)
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",
$❯ 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.",
@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,
@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