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
| git checkout --track -b next origin/next |
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
| def edit | |
| @quote_option = QuoteOption.get(params[:id]) | |
| @quote_option.quote_option_type.quote_option_sections.length.to_s # => 6, correct | |
| end | |
| def edit | |
| @quote_option = QuoteOption.get(params[:id]) | |
| @quote_option.quote.quote_options.each do |quote_option| | |
| # do nothing |
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 "rubygems" | |
| require "dm-core" | |
| require "spec" | |
| DataMapper::Logger.new(STDOUT, :debug) | |
| DataMapper.setup(:default, "sqlite3::memory:") | |
| class Project | |
| include DataMapper::Resource | |
| property :id, Serial |
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
| var json_data = { | |
| "children": [{ | |
| "children": [ | |
| { | |
| "children": [], | |
| "name": "Factory Records", | |
| "id": "/en/factory_records", | |
| "data": { | |
| "type": "resource" | |
| } |
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
| === Epic Snow Leopard Upgrayyyyd Guide === | |
| Son, you’re now living in the land of 64-bit systems. | |
| That means that some of your 32-bit shit is now broken. | |
| Not all is lost. | |
| == Fixing MySQL weirdness |
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
| # versions used: | |
| # dm-core: | |
| # commit f33ade77050440dcdd590a1ca7ef8709f1e0898d | |
| # Author: Dirkjan Bussink <[email protected]> | |
| # Date: Wed Jun 10 16:36:53 2009 +0200 | |
| # | |
| # dm-more: | |
| # commit 81116667834674db37c7874ee3a3576c7f989c2f | |
| # Author: Dan Kubb <[email protected]> | |
| # Date: Wed Jun 10 10:12:04 2009 -0700 |
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
| // using this.length instead of size makes the ArrayList#clone function work? | |
| array.clone = function( ){ | |
| var a = new ArrayList( this.length ); | |
| for( var i = 0; i < this.length; i++ ){ | |
| a[ i ] = this[ i ]; | |
| } | |
| return a; | |
| }; |
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
| /* faster for loops over arrays */ | |
| var myArray = [ 0, 1, 2, 3, 4, 5 ]; | |
| for( var i = 0, l = myArray.length; i < l; i++ ){ | |
| console.log( myArray[ i ] ); | |
| } |
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
| float totalWeight = 0; | |
| for (int i=0; i < attributes.size(); i++) { | |
| totalWeight += attributes[i].weight*attributes[i].getValues().size(); | |
| } | |
| for (int i = 0 ; i < attributes.size(); i++) { | |
| Attribute attribute = attributes[i]; | |
| ArrayList values = attribute.getValues(); | |
| // calculate dependent on weight (selected attributes have more weight) |
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
| // start expanding tween | |
| public void expand() { | |
| this.fan.continueTo(3.0, 2.0); | |
| } | |
| // start contracting tween | |
| public void contract() { | |
| this.fan.continueTo(1.0, 2.0); | |
| } |