Skip to content

Instantly share code, notes, and snippets.

View mehlah's full-sized avatar
🎯

Mehdi Lahmam mehlah

🎯
  • Grinta
  • Saint-Etienne, France
  • X @mehlah
View GitHub Profile
diff --git i/build_config.rb w/build_config.rb
index 7f52b5ee..c20be4c0 100644
--- i/build_config.rb
+++ w/build_config.rb
@@ -22,6 +22,9 @@ MRuby::Build.new do |conf|
# conf.gem :github => 'iij/mruby-io'
# conf.gem :git => '[email protected]:iij/mruby-io.git', :branch => 'master', :options => '-v'
+ conf.gem :github => 'iij/mruby-env'
+ conf.gem :github => 'mattn/mruby-curl'
@mehlah
mehlah / carrierwave_fog_loading.rb
Last active February 5, 2016 13:20
CarrierWave Fog loading issue #1870
begin
require 'bundler/inline'
rescue LoadError => e
$stderr.puts 'Bundler version 1.10 or later is required. Please update your Bundler'
raise e
end
gemfile(true) do
source 'https://rubygems.org'
gem 'fog-aws'
@mehlah
mehlah / carrierwave_content_type.rb
Created February 5, 2016 10:46
CarrierWave store the content type
begin
require 'bundler/inline'
rescue LoadError => e
$stderr.puts 'Bundler version 1.10 or later is required. Please update your Bundler'
raise e
end
gemfile(true) do
source 'https://rubygems.org'
gem 'rails'
@mehlah
mehlah / carrierwave_content_type.rb
Last active August 22, 2016 03:58
CarrierWave test script for issue #1864
begin
require 'bundler/inline'
rescue LoadError => e
$stderr.puts 'Bundler version 1.10 or later is required. Please update your Bundler'
raise e
end
gemfile(true) do
source 'https://rubygems.org'
gem 'rails'
@mehlah
mehlah / index.html
Last active December 7, 2015 17:04
Browser Paint demo
<body>
<div class="box">Hello</div>
<p>
Lorem ipsum dolor sit amet, consectetur adipisicing elit. Ratione officiis nemo, est quo commodi eos nam quibusdam, ipsa ad natus optio reiciendis quasi enim, aut eum facilis! Similique, accusantium, ullam?
</p>
<p>
Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.
</p>
</body>
module Human
def hello
p 'Hello'
end
end
class Cat
include Human
def mew
class Record
def save
p 'saved!'
end
end
module Validation
def save
p 'validated!'
super
@mehlah
mehlah / alias_method_chain.rb
Last active November 29, 2015 19:11
Alias Method Chain
require 'active_support/all'
class Record
def save
p 'saved!'
end
def save_with_validation
p 'validated!'
save_without_validation
#!/usr/bin/env ruby
require 'rubygems'
require 'time_diff'
require 'twilio-ruby'
TWILIO_SID = 'twilio_sid'
TWILIO_TOKEN = 'twilio_token'
TWILIO_PHONE_NUMBER = '+447903570595'
class Alpha < WorkerCommand
@queue = :alpha
def self.work
sleep(5)
puts "Alpha"
end
end