Skip to content

Instantly share code, notes, and snippets.

http://fkchang.github.io/opal-irb/index-embeddable.html#code:%24classes%20%3D%20%5B%5D%0A%24opal_js_object%20%3D%20Native(%60Opal%60)%20%20%20%20%23%20have%20to%20make%20this%20global%20right%20now%20coz%20not%20seen%20in%20the%20each%20closure%20w%2Fcurrent%20opal%0A%24opal_js_object.each%20%7B%7Ck%7C%0A%20%20attr%20%3D%20%24opal_js_object%5Bk%5D%0A%20%20%24classes%20%3C%3C%20attr%20if%20attr.is_a%3F(Class)%0A%20%20%7D%0A%24classes.uniq.sort_by%20%26%3Aname
source 'https://rubygems.org'
gem 'opal', :git => "git://github.com/opal/opal.git"
gem 'opal-jquery', :git => "git://github.com/opal/opal-jquery.git"
gem 'opal-browser', :git => "git://github.com/opal/opal-browser.git"
gem 'lissio', github: 'meh/lissio'
gem 'paggio', github: 'meh/paggio'
gem 'opal-rspec', :git => "git://github.com/opal/opal-rspec.git"
# extracted from the tracker_api gem
require 'rubygems'
require 'faraday'
require 'faraday_middleware'
if ARGV.size != 2
puts "usage: project_id pivotal_token"
return
end
@fkchang
fkchang / gist:32cd34611c3f714b7bd4
Created April 30, 2015 14:38
trying to use Jruby 9K pre2 on heroku
remote: -----> Ruby app detected
remote: -----> Compiling Ruby/Rails
remote: !
remote: ! An error occurred while installing Ruby ruby-2.2.2-jruby-9.0.0.0.pre2
remote: ! For supported Ruby versions see https://devcenter.heroku.com/articles/ruby-support#supported-runtimes
remote: ! Note: Only the most recent version of Ruby 2.1 is supported on Cedar-14
remote: ! Command: 'set -o pipefail; curl --fail --retry 3 --retry-delay 1 --connect-timeout 3 --max-time 30 https://s3-external-1.amazonaws.com/heroku-buildpack-ruby/cedar/ruby-2.2.2-jruby-9.0.0.0.pre2.tgz -s -o - | tar zxf - ' failed unexpectedly:
SongBandSuggestorYoutubelyricsNotesSelected
BadU2BM
Basket CaseGreen Dayfkclinklinkor Longview
Best of Both WorldsVan HalenBM
alert "Gonna talk"
(1..8).each {|i| say i }
say "who do we appreciate? Opal!"
<!DOCTYPE html>
<meta charset="utf-8" />
<title>WebSocket Test</title>
<script language="javascript" type="text/javascript">
// var wsUri = "ws://echo.websocket.org/";
var wsUri = "ws://localhost:8081/";
var output;
function init() {
output = document.getElementById("output");
testWebSocket();
(0..10).each {|i| puts "require_remote is cool" }
@fkchang
fkchang / rails_apps_composer_cmd
Created April 26, 2012 23:08
rails_apps_composer command for "How to build a Rails app knowing almost nothing"
rails_apps_composer new blog -r haml rspec cucumber guard mongoid seed_database omniauth home_page home_page_users html5 simple_form users_page omniauth_email cleanup extras
@fkchang
fkchang / gist:3956417
Created October 26, 2012 01:07
rails gem file for opal_test - used in OCRuby presentation on opal 10/25/2012
# prerequisites: Ruby 1.9.3, Rails 3.2.something recent
###
### Setup rails app w/haml and opal
###
# create app
rails new opal_test
# add to Gemfile below rails