Skip to content

Instantly share code, notes, and snippets.

View aarongough's full-sized avatar

Aaron Gough (He/Him) aarongough

View GitHub Profile
<% @searchresults.each do |movie| %>
Found: <%= movie.name %> | <%= movie.id %><br />
<% end %>
content_for :js do
<!-- Output the base view-model code for our User resource. The view-model
will by default have client-side validations that mimic the server-side
model validations. It will also only expose interface methods for
attributes that are marked as accessible on the server-model
-->
<%= User.generate_view_model :update => :onchange %>
end
<!-- Now create the HTML elements that are bound to our view-model -->
framework 'cocoa'
class Application
def applicationDidFinishLaunching(notification)
frame = NSRect.new(NSPoint.new(100, 100), NSSize.new(300, 300))
@main_window = NSWindow.alloc.initWithContentRect(
frame,
:styleMask => (NSTitledWindowMask | NSClosableWindowMask),
:backing => NSBackingStoreBuffered,
unknown: warning: instance variable @inheritable_attributes not initialized
unknown: warning: instance variable @inheritable_attributes not initialized
unknown: warning: instance variable @inheritable_attributes not initialized
unknown: warning: instance variable @__instance__ not initialized
unknown: warning: instance variable @inheritable_attributes not initialized
unknown: warning: instance variable @inheritable_attributes not initialized
unknown: warning: instance variable @inheritable_attributes not initialized
unknown: warning: instance variable __attached__ not initialized
unknown: warning: instance variable __attached__ not initialized
unknown: warning: instance variable __attached__ not initialized
require 'benchmark'
require 'sexpistol'
require 'sxp'
class Lexer
def initialize(str)
@str = str
@p = 0
end
require 'benchmark'
require 'sexpistol'
require 'sxp'
class Lexer
def initialize(str)
@str = str
@p = 0
end
require 'benchmark'
require 'sexpistol'
require 'sxp'
example_sexp = <<-EOD
((display "This is a test string!")
(define test (lambda () (begin
(display (== 1 1))
# Benchmark this system's performance from a developer's perspective.
#
# * Configure and compile Ruby
# * Run the test suite of several medium sized Ruby applications
# * Run the database-heavy test-suite of a Rails application
# * Test the launch times of several common applications
class DeveloperBenchmark
require 'fileutils'
%%{
machine simple_lexer;
integer = ('+'|'-')?[0-9]+;
float = ('+'|'-')?[0-9]+'.'[0-9]+;
assignment = '=';
identifier = [a-zA-Z][a-zA-Z_]+;
main := |*
def emit(token_name, data, target_array, ts, te)
target_array << {:name => token_name.to_sym, :value => data[ts...te].pack("c*") }
end