See https://www.youtube.com/watch?v=4_RJu_TrqO0&feature=youtu.be&t=8h6m40s
$ ruby dilute.rb fib.rb
def fi n
if n < 3
1
else
fib(n-1 + ib(n
end
| #printf | |
| RUN printf '#!/bin/bash\n\ | |
| echo hello world from line 1\n\ | |
| echo hello world from line 2'\ | |
| >> /tmp/hello | |
| #echo | |
| RUN echo -e '#!/bin/bash\n\ | |
| echo hello world from line 1\n\ | |
| echo hello world from line 2'\ |
See https://www.youtube.com/watch?v=4_RJu_TrqO0&feature=youtu.be&t=8h6m40s
$ ruby dilute.rb fib.rb
def fi n
if n < 3
1
else
fib(n-1 + ib(n
end
| input { | |
| file { | |
| type => "rails" | |
| path => "/log/development.log" | |
| tags => ["development"] | |
| } | |
| } | |
| filter { | |
| if [type] == "rails" { |
See https://www.youtube.com/watch?v=4_RJu_TrqO0&feature=youtu.be&t=8h6m40s
$ ruby dilute.rb fib.rb
def fi n
if n < 3
1
else
fib(n-1 + ib(n
end
| #!/bin/bash | |
| # This script can be used in "run & hope" mode or you can use it as a recipe to | |
| # do things manually - you probably want the latter if you really care about | |
| # the data in your databases. | |
| # Happy hacking | |
| # /Eoin/ | |
| # Tell bash to stop if something goes wrong | |
| set -e |
| define_behavior :fades do | |
| requires :director | |
| setup do # |opts| | |
| fade_out_time = 3_000 | |
| actor.has_attributes total_fade_time: fade_out_time, fade_time: fade_out_time | |
| director.when :update do |time_ms, secs| | |
| actor.fade_time -= time_ms | |
| alpha = 255 * actor.fade_time / actor.total_fade_time | |
| actor.remove if actor.fade_time <= 0 |
| define_stage :demo do | |
| requires :tween_manager | |
| curtain_up do | |
| @player = spawn :player, x: 10, y:30 | |
| tween = tween_manager.tween_properties @player, {x: 600, y:750}, 6_000, Tween::Sine::InOut | |
| # tweens can be canceled if need be, or they will clean themselves up when finished | |
| timer_manager.add_timer :foo, 3_000, false do | |
| tween.cancel! | |
| end |
Imma turn this into a blog post soon but in the meantime wanted to give the Google index a hit on
cannot load such file -- grape-swagger
The grape-swagger gem is forked right now (2015-01-23). If you simply follow the docs, you're going to get a require error.
In Gemfile, change gem "grape-swagger-rails" to this: gem "grape-swagger-rails", github: "BrandyMint/grape-swagger-rails"
| package main | |
| import ( | |
| "bytes" | |
| "flag" | |
| "image" | |
| "image/color" | |
| "image/draw" | |
| "image/jpeg" | |
| "log" |
| # Python boolean fail | |
| # Or how to redefine True and False and win any argument on the internet! | |
| # Love, @tlehman | |
| from unittest import TestCase | |
| class BoolFail(TestCase): | |
| def test_false(self): | |
| True = False | |
| assert True == False |