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
| module DataMapper::Model | |
| def property_names | |
| properties.map { |m| m.name.to_s } | |
| end | |
| 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
| # Apparently JRuby doesn't have a File#size (instance) method, | |
| # but does have the equivalent class method | |
| if !File.method_defined? :size | |
| class File | |
| def size | |
| File.size(path) | |
| end | |
| end | |
| 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
| require 'prawn' | |
| Prawn.debug = true | |
| Prawn::Document.generate("test.pdf", :page_layout => :landscape) do |pdf| | |
| Header = Struct.new(:title, :width) | |
| headers = [Header.new("Header\nOne", 50), | |
| Header.new("Header\nTwo", 50), | |
| Header.new("Header\nThree", 50)] | |
| pdf.stroke_bounds |
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
| (For better formatting, please see the Craigslist version of this ad: http://madison.craigslist.org/cto/2531807957.html) | |
| 2008 Ford Escape HEV - $15,995 OBO | |
| Color: Silver | |
| Miles: 90,332 | |
| Drive: Front Wheel Drive | |
| Transmission: Automatic | |
| VIN: 1FMCU49H98KA18705 | |
| **Price Reduced! | |
| ***Free CarFax report available here |
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
| Free CarFax report: http://www.carfax.com/cfm/FSBO.cfm?report=66547FA0B89CD0D19E9DF4F776C0A4A5 | |
| Image gallery: http://katyavoelker.imgur.com/0BZ27/all | |
| Hybrid alert - gets 30/34mpg (hwy/city)! FULLY LOADED: factory GPS navigation system and touch screen electronic control panel (incl. hybrid engine HUD), Audiophile sound system, heated leather seats, keyless entry (number pad on driver door), separate driver and passenger climate control, backup sensor, multi-disc CD player, factory rear window tint, roof rack, rear window wiper and defrost, bug shield, AC power outlet in front and two DC (1 front/1 back), etc. | |
| We've really enjoyed having this vehicle, however, we recently moved to a more urban area and simply don't need two vehicles any more. The vehicle was been well-maintained; oil changed every 3.5K miles and recent tune-ups we've done to get car ready for sale include: two new tires (BF Goodrich), a spare full-sized tire under the vehicle, new front and rear brake pads, new rear rotors, new MECS Pump, ti |
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
| 2008 Ford Escape HEV - $15,995 OBO | |
| Color: Silver | |
| Miles: 90,332 | |
| Drive: Front Wheel Drive | |
| Transmission: Automatic | |
| VIN: 1FMCU49H98KA18705 | |
| **Price Reduced! | |
| ***Free CarFax report available here | |
| ****More pictures can be seen at: http://katyavoelker.imgur.com/0BZ27/all |
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
| // Test directly from shell using (e.g. input 5): | |
| // scala -i fibonacci.scala -e 'println(fibonacci(5))' | |
| def fibonacci(n: Int) = fibonacci_tail_recursive(n, 1, 0) | |
| def fibonacci_tail_recursive(iter: Int, current: BigInt, last: BigInt): BigInt= { | |
| if (iter == 0) | |
| last | |
| else | |
| fibonacci_tail_recursive(iter-1, current+last, current) |
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
| // Test directly from shell using (e.g. input 5): | |
| // scala -i factorial.scala -e 'println(factorial(5))' | |
| def factorial(n: BigInt): BigInt = { | |
| if (n <= 1) | |
| 1 | |
| else | |
| n * factorial(n - 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
| # This snippet is for parsing output from the Unicode 'property' Web app at | |
| # http://unicode.org/cldr/utility/properties.html | |
| # | |
| # Be sure to check the 'Abbreviate' and 'UCD format' boxes, and leave | |
| # 'Escape' unchecked. Copy the hex ranges to an external file, and set its | |
| # path in FILE below. | |
| # Last tested on 2011/06/12 | |
| # | |
| # Written by Abe Voelker (http://abevoelker.com) |
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
| // Sassified color version created by Abe Voelker. | |
| // Based on the original white version by Mark Otto: | |
| // http://markdotto.com/playground/3d-text/ | |
| @mixin color-3D-text($color) { | |
| text-shadow: 0 1px 0 $color / 1.25, | |
| 0 2px 0 $color / 1.268656716, | |
| 0 3px 0 $color / 1.363636364, | |
| 0 4px 0 $color / 1.378378378, | |
| 0 5px 0 $color / 1.5, |