This file contains hidden or 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
| Thing = function() { | |
| var thing = {... some initial content...}; | |
| (function(a, b, options) { | |
| var local1, local2; // forward-declare private methods | |
| this.method = function() { | |
| ... local1(a,b); ... | |
| }; | |
| local1 = function(c, d) { | |
| ... | |
| }; |
This file contains hidden or 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
| <html> | |
| <head> | |
| <script src="https://github.com/DmitryBaranovskiy/raphael/raw/master/raphael-min.js"></script> | |
| <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script> | |
| </head> | |
| <body> | |
| <div id="container" style="position:absolute;left:25%;right:25%;top:25%;bottom:25%;background-color:#DDD"> | |
| </div> | |
| <script type='text/javascript'> | |
| var container = $('#container'); |
This file contains hidden or 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
| <html> | |
| <head> | |
| <script src="https://github.com/DmitryBaranovskiy/raphael/raw/master/raphael-min.js"></script> | |
| <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.2/jquery.min.js"></script> | |
| </head> | |
| <body> | |
| <div id="container" style="position:absolute;left:25%;right:25%;top:25%;bottom:25%;background-color:#DDD"> | |
| </div> | |
| <script type='text/javascript'> | |
| var container = $('#container'); |
This file contains hidden or 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
| class Authentication | |
| include DataMapper::Resource | |
| belongs_to :user | |
| property :id, Serial | |
| property :user_id, Integer | |
| property :provider, String | |
| property :uid, String, :length => 240 | |
| property :user_name, String, :length => 240 | |
| property :user_email, String, :length => 240 |
This file contains hidden or 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 'uuidtools' | |
| class User | |
| include DataMapper::Resource | |
| property :id, UUID, :key => true, :required => true, :default => proc { UUIDTools::UUID.random_create } | |
| has n, :projects | |
| has n, :deltas | |
| end |
This file contains hidden or 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
| #!/usr/bin/env ruby | |
| # | |
| # 1304046900 CONVERTS SVG TO RAPHAËL | |
| require "nokogiri" | |
| file = "world.svg" | |
| tree = Nokogiri::XML(File.open(file)) | |
| str = |
This file contains hidden or 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
| $ sudo port install libusb | |
| ---> Fetching archive for libusb | |
| ---> Attempting to fetch libusb-1.0.9_0.darwin_11.x86_64.tbz2 from http://packages.macports.org/libusb | |
| ---> Attempting to fetch libusb-1.0.9_0.darwin_11.x86_64.tbz2.rmd160 from http://packages.macports.org/libusb | |
| ---> Installing libusb @1.0.9_0 | |
| ---> Activating libusb @1.0.9_0 | |
| ---> Cleaning libusb | |
| ---> Updating database of binaries: 100.0% | |
| ---> Scanning binaries for linking errors: 100.0% | |
| ---> No broken files found. |
This file contains hidden or 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
| #define OFFS -306 /* Offset to epoch-day (Day 1 is 1/1/0001) */ | |
| #define WD 0L /* Day of week offset */ | |
| /* | |
| * datol: takes a YMD date, and returns the number of days since some base | |
| * date (in the very distant past). | |
| * | |
| * Handy for getting date of x number of days before/after a given date. | |
| * A date is valid if ltodate() yields the same YMD you started with. | |
| * |
This file contains hidden or 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
| if ENV["RSPEC_REPORT_EXCEPTIONS"] | |
| class Exception | |
| alias_method :old_initialize, :initialize | |
| def self.exceptions_seen | |
| @@seen ||= {} | |
| end | |
| def self.see args | |
| stack = caller[1..-1] |
This file contains hidden or 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
| #! /usr/bin/ruby | |
| # | |
| # mved: Rename files from foo*bar to some*thing. | |
| # The "from" and "to" patterns must have one * or one ? each (escape it fron the shell) | |
| # | |
| # Author: Clifford Heath. | |
| # (c) Copyright 2013. | |
| # Free for any purpose, but don't claim you wrote it. | |
| require "getoptlong" |