Skip to content

Instantly share code, notes, and snippets.

👍
webby goodness

Tad Thorley phaedryx

👍
webby goodness
Block or report user

Report or block phaedryx

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View modules_with_methods.rb
module Debug
def whoAmI?
"#{self.type.name} (\##{self.id}): #{self.to_s}"
end
end
class Phonograph
include Debug
def initialize(title)
@title = title
View gist:2962074
def leppard
self.pour(@sugar)
end
View gist:2316002
(function() {
"use strict";
(42, eval)('var z = 5');
}());
View gist:1803342
module Foo
class BarGenerator < Rails::Generators::Base
class_option :baz, :aliases => '-b', :type => :string, :default => 'quux', :desc => 'foobar is unfoo'
def bar
puts options[:baz]
end
end
end
View gist:1747038
var Student;
var students;
var student1;
var student2;
var i, len, student;
Student = (function() {
function Student(fname, lname) {
this.firstName = fname;
this.lastName = lname;
@phaedryx
phaedryx / final-marker.js.coffee
Created Nov 20, 2011
Example code for my DragMarkers project (part 3)
View final-marker.js.coffee
class App.Marker extends Spine.Model
@configure 'Marker', 'latitude', 'longitude', 'icon'
@extend Spine.Model.Ajax
constructor: ->
super
@gmarker = new google.maps.Marker(
position: new google.maps.LatLng(@latitude, @longitude)
icon: @icon
draggable: true
@phaedryx
phaedryx / 2-markers_controller.js.coffee
Created Nov 20, 2011
Example code for my DragMarkers project (part 2)
View 2-markers_controller.js.coffee
$ = jQuery.sub()
Marker = App.Marker
class App.MarkersController extends Spine.Controller
elements:
"#map" : "mapEl"
".marker" : "markerIcons"
constructor: ->
super
@phaedryx
phaedryx / 1-application.js.coffee
Created Nov 19, 2011
Example code for my DragMarkers project (part 1)
View 1-application.js.coffee
#= require spine/spine
#= require spine/ajax
#= require_tree ./lib
#= require_self
#= require_tree ./models
#= require_tree ./controllers
#= require_tree ./views
#= require_tree .
View destructured_assignment.coffee
weatherReport = (location) ->
# Make an Ajax request to fetch the weather...
[location, 72, "Mostly Sunny"]
[city, temp, forecast] = weatherReport "Berkeley, CA"
futurists =
sculptor: "Umberto Boccioni"
painter: "Vladimir Burliuk"
poet:
You can’t perform that action at this time.