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
| # | |
| # Vision of how Diesel works | |
| # | |
| # Initialize engine from singleton | |
| game = D.Game.get | |
| title: "Chain Reaction Game v1.0" | |
| container: document.querySelector('#game') | |
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 'nokogiri' | |
| require 'open-uri' | |
| require 'net/http' | |
| # Patterns | |
| patterns = {} | |
| # Load first page | |
| doc = Nokogiri::HTML(open('http://www.mobile-patterns.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
| require 'nokogiri' | |
| require 'open-uri' | |
| require 'net/http' | |
| # Patterns | |
| patterns = {} | |
| # Load first page | |
| doc = Nokogiri::HTML(open('http://pttrns.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
| static inline double radians (double degrees) {return degrees * M_PI/180;} | |
| CGImageRef CreateRotatedImage(CGImageRef imageRef, UIImageOrientation orientation) | |
| { | |
| CGRect bnds = CGRectZero; | |
| CGImageRef copy = nil; | |
| CGContextRef ctxt = nil; | |
| CGRect rect = CGRectZero; | |
| CGAffineTransform tran = CGAffineTransformIdentity; |
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
| on run {input, parameters} | |
| tell application "System Events" | |
| set activeApp to name of first process whose frontmost is true | |
| end tell | |
| set _timestamp to (input as string) | |
| tell application activeApp | |
| set realDate to ((do shell script "date -r " & _timestamp) as string) |
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
| - (void)drawBevelArea | |
| { | |
| CGColorSpaceRef colorSpace = CGColorSpaceCreateDeviceRGB(); | |
| CGContextRef context = UIGraphicsGetCurrentContext(); | |
| CGRect frame = self.frame; | |
| CGRect bevelAreaRect = CGRectMake(0, 0, frame.size.width, frame.size.height); | |
| UIBezierPath* bevelAreaPath = [UIBezierPath bezierPathWithRoundedRect:bevelAreaRect cornerRadius:_cornerRadius]; | |
| [_bevelBackgroundColor setFill]; |
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
| Terrest.Router.reopen | |
| location: 'history' | |
| Terrest.Router.map -> | |
| @resource "builds", path: "/builds/:build_race", -> | |
| @resource "build", path: ":build_slug" |
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
| type Race string | |
| const ( | |
| Protoss Race = "protoss" | |
| Terran Race = "terran" | |
| Zerg Race = "zerg" | |
| ) |
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
| // Build struct | |
| type Build struct { | |
| Name string // Short name for this build | |
| Description []byte // Description explaining what the build is about | |
| PlayerRace Race // The race this built is meant to be played with | |
| OpposingRaces []Race // The target races this build works well against | |
| } |
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
| // Available races | |
| type Race string | |
| const ( | |
| Protoss Race = "protoss" | |
| Terran Race = "terran" | |
| Zerg Race = "zerg" | |
| ) | |
| func (r *Race) iconFileURL() string { | |
| // TODO: |