Skip to content

Instantly share code, notes, and snippets.

def kikou(if:)
binding.local_variable_set(:if, binding.local_variable_get(:if) + 1)
binding.local_variable_get(:if)
end
kikou(if: 2)
@midu
midu / kik.md
Last active August 29, 2015 14:21

#ruby #php

#ruby #php

RSpec.describe [1, 2, 3] do
it { is_expected.to include(1) }
it { is_expected.not_to include(4) }
it { is_expected.to include(Fixnum) }
it { is_expected.to include(Object) }
it { is_expected.not_to include(Float) }
end
@midu
midu / noob.rb
Last active August 29, 2015 14:20
def can_close?(n, open, close)
open > close
end
def can_open?(n, open, close)
n > (open - close)
end
def par(res = '', n = 0, open = 0, close = 0)
if n == 0

The most advanced pokemon game, ever.

Implement a pokemon game with three different Pokemons:

  • Bulbasaur, of type Plant.
  • Charmander, of type Fire.
  • Squirtle, of type Water.
results = for testValue in [false, [], 0, {}, '', null, undefined, (->), true, '0']
  a = testValue
  b = testValue
  
  {
    "value": testValue
    '||=': a ||= 'assigned'
    '?=': b ?= 'assigned'
 }
@midu
midu / html.html
Last active August 29, 2015 14:08
<blockquote class="twitter-tweet" lang="en">
<p>
.<a href="https://twitter.com/NinthWardNYC">@NinthWardNYC</a> please bring the arrogant bastard back!!!
</p>
&mdash; Stefano B. (@jerefuse) <a href="https://twitter.com/jerefuse/status/525775452107833345">October 24, 2014</a>
</blockquote>
<script async src="//platform.twitter.com/widgets.js" charset="utf-8"></script>