I hereby claim:
- I am arches on github.
- I am arches (https://keybase.io/arches) on keybase.
- I have a public key whose fingerprint is 1362 D442 CE1B 48CC B351 EB24 07EE E79C E2D8 8D2C
To claim this, I am signing this object:
var Arch; if (!Arch) Arch = {}; // set up custom namespace 'Arch' | |
Arch.AjaxPagination = function(paginationContainer, storiesContainer, filtersContainer) { | |
// Only html5 browsers can use ajax pagination. We don't want no stinkin' hashbang URLs. | |
if (!history.pushState) { | |
return; | |
} | |
this.$paginationContainer = $(paginationContainer); |
monitor: bundle exec ruby monitor.rb |
I hereby claim:
To claim this, I am signing this object:
var Arch; if (!Arch) Arch = {}; // set up custom namespace 'arch' | |
Arch.Flash = { | |
showError: function(message) { | |
if (message == "") return; | |
$('#flash-msg .user-msg-detail').removeClass('notice'); | |
$('#flash-msg .user-msg-detail').addClass('error'); | |
$('#flash-msg .user-msg-detail span').html(message); | |
$('#flash-msg').show(); | |
}, |
#!/usr/bin/env ruby | |
require 'json' | |
require 'shellwords' | |
if ARGV.length < 3 then | |
puts "Usage: squirt <filename> <channel> <comment>" | |
exit | |
end |
# before - each object in the enumerable is passed to the block | |
posts.select { |post| post.comments.any? } | |
class Array | |
def select(&blk) | |
if blk.arity == 0 | |
super { |obj| obj.instance_exec &blk } | |
else | |
super | |
end |
require 'forwardable' | |
class Bob | |
def hey(message) | |
message = Message.new(message) | |
case | |
when message.shouting? | |
"Woah, chill out!" | |
when message.question? |
require 'active_support/hash_with_indifferent_access' | |
class Cart | |
include Enumerable | |
attr_writer :storage | |
def each(&blk) | |
deal_ids.each(&blk) | |
end |
> my_array = [{server: "localhost", ip: "192.168.0.1"}, {server: "google dns", ip: "8.8.8.8"}] | |
> tp my_array | |
SERVER | IP | |
-----------|------------ | |
localhost | 192.168.0.1 | |
google dns | 8.8.8.8 | |
# or with objects | |
> class ServerInfo |
def foobar(&blk) | |
yield "bar" if blk | |
"foo" | |
end | |
> foobar | |
=> "foo" | |
> foobar {|x| puts x} | |
bar | |
=> "foo" |