To start godoc at log in time (so it always there on port 6060 when you need it):
- copy smarticus.godoc.plist to in ~/Library/LaunchAgents
launchctl load ~/Library/LaunchAgents/smarticus.godoc.plist
- visit http://localhost:6060
AFOAuthCredential* credential = [AFOAuthCredential credentialWithOAuthToken:accessToken tokenType:kAFOAuthCodeGrantType]; | |
[credential setRefreshToken:refreshToken expiration:expirationDate]; | |
AFOAuth2Client* oAuth2Client = [AFOAuth2Client clientWithBaseURL:[NSURL URLWithString:baseUrl] | |
clientID:clientID | |
secret:secret]; | |
[oAuth2Client setAuthorizationHeaderWithToken:accessToken]; | |
// This line is for environment where you don't have valid certificate. | |
// For example for development environment | |
[oAuth2Client setAllowsInvalidSSLCertificate:YES]; |
- (void)viewController:(GTMOAuth2ViewControllerTouch *)viewController | |
finishedWithAuth:(GTMOAuth2Authentication *)auth | |
error:(NSError *)error { | |
if (error != nil) { | |
// Authentication failed | |
} else { | |
// Authentication succeeded | |
} | |
} |
x = 1 | |
xs = [x] | |
10.times { x = Math::exp(Math::log(x) + 0.5); xs << x } | |
puts xs.inspect |
To start godoc at log in time (so it always there on port 6060 when you need it):
launchctl load ~/Library/LaunchAgents/smarticus.godoc.plist
module Smarticus | |
class Prs | |
PLAYS = %w[p r s] | |
def play(previous=[]) | |
PLAYS[rand(3).to_i] | |
end | |
def name |
using System; | |
using System.IO; | |
using System.Runtime.Serialization.Json; | |
using BarCloudDL; | |
public class Program | |
{ | |
public static void Main (string[] args) | |
{ |
make your changes now |
foo |
foo |
require 'rubygems' | |
require "test/unit" | |
require "shoulda" | |
def score(roll) | |
accum = 0 | |
raise ArgumentError unless roll.is_a? Array | |
raise RuntimeError unless roll.any?{|r| r.is_a? Fixnum } | |
raise RuntimeError if roll.any?{|r| r < 1} |