This file contains 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 ApiController < ApplicationController | |
respond_to :json | |
class Pong < Object | |
attr_accessor :pong | |
def initialize | |
@pong = true | |
end |
This file contains 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 ApiController < ApplicationController | |
respond_to :json | |
class Pong < Object | |
attr_accessor :pong | |
def initialize | |
@pong = true | |
end |
This file contains 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
CLLocationCoordinate2D min = CLLocationCoordinate2DMake(99999.0, 99999.0); | |
CLLocationCoordinate2D max = CLLocationCoordinate2DMake(-99999.0, -99999.0); | |
// find max/min.... | |
// zoom to cover area | |
// TODO: Maybe better using a MKPolygon which can calculate its own fitting region. | |
CLLocationCoordinate2D center = CLLocationCoordinate2DMake((max.latitude + min.latitude) / 2.0, (max.longitude + min.longitude) / 2.0); | |
MKCoordinateSpan span = MKCoordinateSpanMake(max.latitude - min.latitude, max.longitude - min.longitude); | |
MKCoordinateRegion region = MKCoordinateRegionMake(center, span); |
This file contains 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 'spec_helper' | |
describe 'api' do | |
# routing | |
it 'should route to v1 /me correctly' do | |
assert_routing('/api/v1/me', { :controller => 'me', :action => 'show' }); | |
end | |
# controllers |
This file contains 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
#import <UIKit/UIKit.h> | |
@interface CWView : UIView | |
// for child class to override and change the behavior (if needed) | |
@property (nonatomic, readonly) BOOL useNib; | |
@end |
This file contains 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
config.autoload_paths += %W(#{config.root}/app/workers) | |
config.autoload_paths += %W(#{config.root}/app/presenters) | |
config.autoload_paths += %W(#{config.root}/lib/addresstalk/errors) | |
config.autoload_paths += %W(#{config.root}/lib) | |
config.autoload_paths += %W(#{config.root}/lib/addresstalk) |
This file contains 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
$ npm install | |
npm WARN [email protected] package.json: bugs['web'] should probably be bugs['url'] | |
npm WARN [email protected] dependencies field should be hash of <name>:<ve |
This file contains 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 (var i = 0; i < 10; i++) if ((function(i) { | |
return (i < 5) ? console.log(i) : true; | |
})(i)) break; |
This file contains 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 unscoped = function(objName) { | |
return eval(objName); | |
}; | |
var x = 111; | |
function newScope() { | |
var x = 222; | |
return unscoped('x'); | |
}; |
This file contains 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
$ ping 8.8.8.8 | |
PING 8.8.8.8 (8.8.8.8): 56 data bytes | |
Request timeout for icmp_seq 0 | |
64 bytes from 8.8.8.8: icmp_seq=1 ttl=46 time=100.654 ms | |
64 bytes from 8.8.8.8: icmp_seq=1 ttl=46 time=103.946 ms (DUP!) | |
64 bytes from 8.8.8.8: icmp_seq=1 ttl=46 time=105.836 ms (DUP!) | |
64 bytes from 8.8.8.8: icmp_seq=1 ttl=46 time=114.566 ms (DUP!) | |
64 bytes from 8.8.8.8: icmp_seq=1 ttl=46 time=115.913 ms (DUP!) | |
64 bytes from 8.8.8.8: icmp_seq=1 ttl=46 time=118.262 ms (DUP!) | |
64 bytes from 8.8.8.8: icmp_seq=1 ttl=46 time=125.349 ms (DUP!) |