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
| attributes_value: self.template_eval "\$H($attributes_hash)" |
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 Base | |
| someMethod: -> | |
| puts "hello from Base" | |
| class Derived extends Base | |
| someOtherMethod: -> | |
| @someMethod() | |
| x: new Derived() | |
| x.someOtherMethod() |
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
| $(document).ready -> | |
| gSmallShadow: new google.maps.MarkerImage("http://labs.google.com/ridefinder/images/mm_20_shadow.png", new google.maps.Size(22, 20), new google.maps.Point(0, 0), new google.maps.Point(6, 20)) | |
| gYellowIcon: new google.maps.MarkerImage("http://labs.google.com/ridefinder/images/mm_20_yellow.png", new google.maps.Size(12, 20), new google.maps.Point(0, 0), new google.maps.Point(6, 20)) | |
| places: {} | |
| updatePlaces: -> | |
| bounds: map.getBounds() | |
| ne: bounds.getNorthEast() | |
| sw: bounds.getSouthWest() | |
| $.ajax({ |
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
| when World.Surface.CANVAS.FORE | |
| g: context.createRadialGradient 0, 0, 0, 0, 0, 50 | |
| g.addColorStop 0.4, "rgba(150, 183, 51, 1)" | |
| g.addColorStop 0.9, "rgba(150, 183, 51, 0)" | |
| context.fillStyle: g2 | |
| context.beginPath() | |
| context.arc 0, 0, 45, 0, Math.PI*2, true | |
| context.closePath() | |
| context.fill() |
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 process? | |
| Obj: exports | |
| Hash: require './hash' | |
| else | |
| window.Obj: {} | |
| window.Hash: {} |
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 process? | |
| Obj: exports | |
| Hash: require './hash' | |
| else | |
| Obj: window.Obj: {} | |
| Hash: window.Hash: {} |
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
| # sample use: node nodeproxy.js 127.0.0.1 88 127.0.0.1 80 | |
| net: require 'net' | |
| sys: require 'sys' | |
| [proxyHost, proxyPort, proxyTargetHost, proxyTargetPort]: process.argv.slice(2) | |
| proxyServer: net.createServer (source_stream) -> | |
| source_stream.addListener 'connect', -> | |
| target_stream: new net.Stream() | |
| target_stream.addListener 'connect', -> sys.pump source_stream, target_stream |
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
| switch(protocol) { | |
| //first set it to secure | |
| case "https:": | |
| stream.setSecure(true) | |
| case "http:": | |
| stream.write(text) | |
| stream.end() | |
| break | |
| case "ftp:": | |
| ... |
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 Planet | |
| constructor: (@name, @size, @x, @y) -> | |
| @ships = {} | |
| battle: -> | |
| for p of @ships | |
| damage = randint @ships[p] | |
| add_ships: (player, amount) -> | |
| if @ships[player]? |
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
| function Client() { | |
| this.state = "loggedoff" | |
| } | |
| //attempt to say something, will attempt login every time and keep you at as far as you have gotten | |
| Client.prototype.say = function(msg) { | |
| switch(this.state) { | |
| case "loggedoff": | |
| this.queueLogin() | |
| case "authenticated": |