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 'aws-sdk-core' | |
require 'active_support' | |
require 'active_support/core_ext' | |
cw = Aws::CloudWatch::Client.new( region: 'us-east-1') | |
resp = cw.get_metric_statistics( | |
namespace: "AWS/Billing", | |
metric_name: "EstimatedCharges", | |
dimensions: [ | |
{name: "Currency", value: "USD"} |
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
return unless yes?('Use Template?') | |
# clean file | |
run 'rm README.rdoc' | |
gem 'kaminari' # Pagenation | |
gem 'slim-rails' | |
gem 'simple_form' | |
gem 'puma' | |
gem 'rails-config' |
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
// $ rails new fuga --skip-bundle --skip-test-unit -d sqlite3 | |
$ cd fuga | |
$ bundle install --path vendor/bundle --without production |
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 'rest_client' | |
require 'json' | |
params_json = "{ \"receipt-data\": \"#{open("./receipt").read}\" }" | |
apple_url = "https://buy.itunes.apple.com/verifyReceipt" | |
receipt_data = "#{open("./receipt").read}" | |
#p receipt_data | |
res = RestClient.post apple_url, {:'receipt-data' => receipt_data}.to_json | |
res = JSON.parse(res) |
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
[NSDate dateWithTimeIntervalSince1970:@"1342665568" doubleValue]]; |
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
// font is UIFont object | |
[segmentedCtrl setTitleTextAttributes: | |
[NSDictionary dictionaryWithObject:font forKey:UITextAttributeFont] forState:UIControlStateNormal]; |
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
NSString *domainName = [[NSBundle mainBundle] bundleIdentifier]; | |
[[NSUserDefaults standardUserDefaults] removePersistentDomainForName:domainName]; |