This file contains 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 'gctools/oobgc' | |
class GcObb | |
def initialize(app) | |
@app = app | |
end | |
def call(env) | |
response = @app.call(env) | |
env['rack.after_reply'] << proc { GC::OOB.run } |
This file contains 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
<%= form_tag search_couches_path do -%> | |
<div> | |
<%= label_tag :query %> | |
<%= text_field_tag :query, 'Enter the city here' %> | |
</div> | |
<div><%= submit_tag 'Search' %></div> | |
<% end -%> |
This file contains 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 "minitest/autorun" | |
class MemeTest < Minitest::Test | |
def setup | |
@meme = Meme.new | |
end | |
def test_that_kitty_can_eat | |
assert_equal "OHAI!", @meme.i_can_has_cheezburger? | |
end |
This file contains 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
class Hash | |
# Allow accessing to hash elements using full key path separated by comma. | |
# | |
# hash = {"flash" => {"error" => {"message" => "User type is invalid"}}} | |
# hash.param("flash.error.message") | |
# # => "User type is invalid" | |
# | |
def param(key) | |
return self[key] unless key.is_a?(String) && key.include?(".") | |
key.to_s.split('.').inject(self) do |param, key| |
This file contains 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
class UsersController < ApplicationController | |
def index | |
@users = User.all | |
respond_to do |format| | |
format.json{ render json: @users } | |
format.capn{ render capn: @users } | |
end | |
end | |
end |
This file contains 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
class User | |
attr_accessor :first_name, :last_name, :age | |
def initialize(first_name, last_name, age) | |
@first_name = first_name | |
@last_name = last_name | |
@age = age | |
end | |
def full_name |
This file contains 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
guille 7811 0.0 0.0 2442000 632 s001 S+ 10:05PM 0:00.00 grep tokaido | |
guille 6195 0.0 1.4 2593064 115148 s012 Ss+ 10:05PM 0:03.97 ruby /Users/guille/.tokaido/Gems/bin/rackup --server puma -p 25801 | |
guille 71061 0.0 0.7 2539616 59912 s006 Ss+ 9:46PM 0:03.64 ruby /Users/guille/.tokaido/Gems/bin/rackup --server puma -p 23131 | |
guille 69358 0.0 0.1 2494512 5988 s005 Ss+ 9:45PM 0:01.04 ruby /Users/guille/.tokaido/Gems/bin/rackup --server puma -p 23034 | |
guille 69353 0.0 0.1 2521348 12300 ?? S 9:45PM 0:01.59 /Users/guille/.tokaido/Rubies/2.1.1-p76/bin/ruby -r /Users/guille/.tokaido/Bootstrap/bundle/bundler/setup.rb /Users/guille/.tokaido/Bootstrap/bin/tokaido-bootstrap | |
root 4318 0.0 0.1 2477020 4632 ?? Ss 9:21PM 0:00.13 /Users/guille/.tokaido/Rubies/2.1.1-p76/bin/ruby -r /Users/guille/.tokaido/Bootstrap/bundle/bundler/setup.rb /Users/guille/.tokaido/Bootstrap/firewall/firewall_rules.rb |
This file contains 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
class Deeq < Cask | |
version 'latest' | |
sha256 :no_check | |
url 'http://dl.bithavoc.io/deeq/releases/latest.dmg' | |
homepage 'https://itunes.apple.com/co/app/deeq/id906558269?l=en&mt=12' | |
link 'Deeq-1.0.0.app' | |
end |
This file contains 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 'action_controller' | |
require 'action_controller/log_subscriber' | |
module ActionController | |
class API < Metal | |
abstract! | |
module Compabitility | |
def cache_store; end | |
def cache_store=(*); end |
This file contains 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
def balance(chars: List[Char]): Boolean = { | |
def balanceIter(chars: List[Char], count: Int) : Boolean = | |
if(count < 0) false | |
else if(chars.isEmpty) count == 0 | |
else if(chars.head == '(') balanceIter(chars.tail, count + 1) | |
else if(chars.head == ')') balanceIter(chars.tail, count - 1) | |
else balanceIter(chars.tail, count) | |
balanceIter(chars, 0) | |
} |