Skip to content

Instantly share code, notes, and snippets.

<form id="create_form" class="one-third column alpha" data-bind="submit: createNewLink">
<!-- ko with: newLink -->
<p>
<label for="link_url">Link:</label>
<input type="text" name="link[url]" id="link_url" data-bind="value: url"/>
</p>
<p>
<label for="description">Description:</label>
<input type="text" name="link[description]" id="link_description" data-bind="value: description"/>
</p>
this.allLinks = ko.observableArray();
this.lickedLinks = ko.computed(function() {
return this.allLinks().filter(function(link) {
return link.isLicked();
});
}, this);
this.newLinks = ko.computed(function() {
return this.allLinks().filter(function(link) {
ko.bindingHandlers.hidden = {
update: function(element, valueAccessor){
var value = ko.utils.unwrapObservable(valueAccessor());
ko.bindingHandlers.visible.update(element, function() {
return !value;
});
}
};
$(function(){
App.globalApp = new App();
ko.applyBindings(App.globalApp);
App.globalApp.loadLinks();
});
require 'gosu'
require 'texplay'
class GameWindow < Gosu::Window
def initialize
super 200, 200, false
self.caption = "Scratch-off Sample"
# below we set up the image resources that we'll use for the app
# your base image that will be hidden under the grey layer
@background_image = Gosu::Image.new(self, "a.jpg", true)
# simply grey to cover our first image
get '/hi' do
"Hello World!"
end
get "/test_page" do
markdown :test_file, :layout_engine => :erb
end
def insert_big_arsed_table(array_of_values, created_date)
sql = "COPY big_arsed_table (other_table_id, other_id, other_type, created_at, updated_at) from STDIN WITH DELIMITER AS ',' "
ActiveRecord::Base.connection_pool.with_connection do |conn|
rc = conn.raw_connection
begin
rc.exec(sql)
loop_time = Benchmark.ms do
$ bin/mruby -e "puts 'hello world'"
hello world
$ which ruby
/Users/schneems/.rvm/rubies/ruby-1.9.3-p194/bin/ruby