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
import Control.Monad | |
import Data.List | |
import Primes | |
primes4 = takeWhile (<10000) $ dropWhile (<1000) primes | |
result = do | |
a <- primes4 | |
b <- dropWhile (<= a) primes4 | |
guard ((sort $ show a) == (sort $ show b)) |
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
namespace :generate do | |
desc 'Generate FLMS views in host app for additional styling' | |
task :views do | |
host_view_dir = File.expand_path("../../../app/views/flms/*", __FILE__) | |
unless Dir.exists?("app/views/flms") | |
FileUtils.mkdir "app/views/flms" | |
FileUtils.cp_r Dir[host_view_dir], "app/views/flms/" | |
end | |
end | |
end |
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 'oauth2' | |
client = OAuth2::Client.new('client_id', 'client_secret', :site => 'https://example.org') | |
client.auth_code.authorize_url(:redirect_uri => 'http://localhost:8080/oauth2/callback') | |
# => "https://example.org/oauth/authorization?response_type=code&client_id=client_id&redirect_uri=http://localhost:8080/oauth2/callback" | |
token = client.auth_code.get_token('authorization_code_value', :redirect_uri => 'http://localhost:8080/oauth2/callback', :headers => {'Authorization' => 'Basic some_password'}) | |
response = token.get('/api/resource', :params => { 'query_foo' => 'bar' }) | |
response.class.name | |
# => OAuth2::Response |
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
<a href="http://salty-hollows-7859.herokuapp.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
// Array of ordinals (ASCII character posistions) | |
NSArray *keyStringCharacterOrdinals = @[@99, @109,.....]; | |
NSMutableString *keyString = [[NSMutableString alloc] initWithCapacity:keyStringCharacterOrdinals.count]; | |
for (NSNumber *characterOrdinal in keyStringCharacterOrdinals) { | |
[keyString appendString:[NSString stringWithFormat:@"%c", characterOrdinal.intValue]]; | |
} |
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
{ | |
"cards":[ | |
{ | |
"type":"place", | |
"title":"McDonald's", | |
"imageURL":"http://upload.wikimedia.org/wikipedia/commons/thumb/1/17/DowneyMcdonalds.jpg/240px-DowneyMcdonalds.jpg", | |
"placeCategory":"Fast Food" | |
}, | |
{ | |
"type":"movie", |
OlderNewer