This file contains hidden or 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
<% | |
require 'cgi' | |
require 'uri' | |
def attribute(name, value, force_string = false) | |
if value | |
value_string = | |
if force_string | |
'"' + value + '"' | |
else |
This file contains hidden or 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
$ ls | |
other_thing.exs | |
thing.exs | |
$ elixir thing.exs | |
calling other | |
other thing! | |
hooray! |
This file contains hidden or 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
$ 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 |
This file contains hidden or 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
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 |
This file contains hidden or 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
(ノ^_^)ノ | |
(╯°□°)╯︵ ┻━┻ | |
(ノಠ益ಠ)ノ彡┻━┻ | |
(╯°□°)╯︵ sıɥʇ | |
┬─┬ノ( º _ ºノ) | |
(╯°□°)╯︵ ╯(.□.╯) | |
(╯°□°)╯/(.□. \) | |
ಠ_ಠ | |
ಠ益ಠ | |
¯\_(ツ)_/¯ |
This file contains hidden or 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
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, |
This file contains hidden or 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
$❯ 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.", |
This file contains hidden or 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
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] — [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", |
This file contains hidden or 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
# 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) |
This file contains hidden or 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
Goodbye, world |