This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(send request) | |
+--------+ (poll devices) +----------+ | |
| Device +-- client server --+ Client | | |
+--------+ \---- +------------+ ---/ +----------+ | |
\--| EM Ruby |--/ | |
-/ | Serve- | \-- | |
--/ +------------+ \-- +----------+ | |
+--------+ -/ \+ Client | | |
| Device +/ +----------+ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Hello | |
class Test | |
attr_accessor :registers | |
def initialize() | |
@registers = [] | |
@registers << Alpha.new | |
@registers << Beta.new |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'rubygems' | |
class Foo | |
attr_accessor :mutex | |
attr_accessor :started | |
attr_accessor :running | |
def initialize | |
@mutex = Mutex.new | |
@started = ConditionVariable.new |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defun lat? | |
(lambda (l) | |
(cond | |
((null? l) #t) | |
((atom ? (car l)) (lat? (cdr l))) | |
(else #f)))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defun double? (x) | |
(lambda (x) | |
(x * x))) | |
(double? 3) | |
;; (lambda (x) (x * x)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# db/migrate/20140714041543_create_posts.rb | |
class CreatePosts < ActiveRecord::Migration | |
def change | |
create_table :posts do |t| | |
t.string :title | |
t.text :body | |
t.timestamps | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<table class='foo'> | |
<thead> | |
<tr class='header'> | |
<th class='align-left' colspan='8'>Foo Details</th> | |
</tr> | |
<tr class='sub-header'> | |
<th>Hidden</th> | |
</tr> | |
</thead> | |
<tbody> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(".hidden_comment").change -> | |
enabled = false | |
if this.checked == true | |
enabled = true | |
alert ( $(this.target).attr("id") ) # undefined | |
else | |
alert ( $(this.target).attr("id") ) # undefined |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
rows.each_with_index do |r, i| | |
... | |
#myModal.reveal-modal{"data-reveal" => ""} | |
= form_tag comments_path, :method => :post do | |
= select_tag :reason, options_for_select([['Like', '1'], ['Unlike', '2'], ['Other', '3']], params[:hidden]) | |
= text_area :comments, :rows => 5, :placeholder => '(optional)' | |
= button_tag "Cancel", :type => 'button', :onclick => "$('#myModal').foundation('reveal', 'close')" | |
= submit_tag "Submit", :type => 'button', :name => 'start', :onchange => "this.form.submit();" | |
= form_tag comment |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defun atom? (x) | |
(not (listp x))) | |
(atom? 'Harry) ; t | |
(atom? '(1 2 3)) ; nil | |
(defun member* (a list) | |
(cond | |
((null list) nil) | |
((atom? (car list)) |
OlderNewer