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
+ (BOOL)addSkipBackupAttributeToItemAtURL:(NSURL *)url { | |
NSError *error = nil; | |
BOOL success = [url setResourceValue: [NSNumber numberWithBool: YES] forKey: NSURLIsExcludedFromBackupKey | |
error: &error]; | |
if(!success){ | |
// Error | |
} | |
return success; | |
} |
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
apple_url = “https://buy.itunes.apple.com/verifyReceipt” | |
receipt_data = params[“receipt-data”] | |
res = RestClient.post apple_url, {:’receipt-data’ => receipt_data}.to_json | |
res = JSON.parse(res) | |
if res[“status”] == 21007 | |
apple_url = “https://sandbox.itunes.apple.com/verifyReceipt” | |
receipt_data = params[“receipt-data”] res = RestClient.post apple_url, {:’receipt-data’ => receipt_data}.to_json | |
res = JSON.parse(res) | |
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
ON CONFLICT (id) DO UPDATE SET "title"=EXCLUDED."title","updated_at"=EXCLUDED."updated_at" RETURNING "id" |
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
INSERT INTO "posts" ("id","title","description","created_at","updated_at") | |
VALUES | |
(1,'1つめの記事です','2018-08-22 01:14:24.649575','2018-09-01 00:45:18.474184'), | |
(2,'2つめの記事です','2018-08-22 01:14:24.649575','2018-09-01 00:45:18.474184') | |
ON CONFLICT (id) DO UPDATE SET "title"=EXCLUDED."title","updated_at"=EXCLUDED."updated_at" RETURNING "id" |
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
posts = post_ids.map.with_index(1) do |post_id, i| | |
post = Post.find(post_id) | |
post.title = "#{i}つめの記事です" | |
post | |
end | |
self.import(posts, on_duplicate_key_update: { conflict_target: %i(id), columns: %i(title)) }) |
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
- (NSDictionary *)verifyReceipt:(NSString *)base64Receipt isCoercion:(BOOL)isCoercion isSandbox:(BOOL)isSandbox { | |
if (_completed || isCoercion) { | |
if (base64Receipt) { | |
NSURL *url = [NSURL URLWithString:isSandbox ? @"https://sandbox.itunes.apple.com/verifyReceipt" : @"https://buy.itunes.apple.com/verifyReceipt"]; | |
NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:url]; | |
NSDictionary *requestContents = @{ | |
@"receipt-data": base64Receipt, | |
@"password": SHARED_SECRET | |
}; | |
... |
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
%h1 Squareとの連携 | |
= text_field_tag :price, 100 | |
= button_tag '送信' | |
:javascript | |
const button = document.getElementsByName('button')[0] | |
button.addEventListener('click', () => { | |
const price = document.getElementsByName('price')[0] | |
const dataParameter = { |
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
ja: | |
devise: | |
failure: | |
invited: 'アカウントを作成するには、保留中の招待を承認してください。' | |
invitations: | |
send_instructions: '招待メールが%{email}に送信されました。' | |
invitation_token_invalid: '招待コードが不正です。' | |
updated: 'パスワードが設定されました。お使いのアカウントでログインできます。' | |
updated_not_active: 'パスワードが設定されました。' | |
no_invitations_remaining: 'これ以上招待できません。' |
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
k="乾杯",b="大きな",y="君",n="今",d="日",h="たい",r="ろう" | |
['作詞:','作曲:'].map{|w|w+"長渕剛"} | |
"か#{h}絆に思いをよせて語り尽くせぬ青春の#{d}々#{['傷つき','喜び'].map{|w|a(w)}}肩をたたきあったあの#{d}あれからどれくら#{h.reverse}ったのだ#{r}沈む夕陽をいくつ数えた#{r}故郷の友は#{n}でも#{y}の心の中にいますか" | |
m(k,y,b) | |
"キャンドルライトの中の二人を#{n}こうして目を細めてる#{b}喜びと少しのさみしさを涙の言葉で歌い#{h}明#{d}の光を身体にあびてふり返らずにそのまま行けばよい#{['風に吹か','雨に打た'].map{|w| b(w)}}信じた愛に背を向けるな" | |
2.each(i){m(k,y,b)} | |
m(k,y,b){"#{k}!今#{y}は人生の#{b*2}舞台に立ち遥か長い道のりを歩き始めた#{y}に幸せあれ!"} | |
a(k){"時には#{k}"} | |
b(k){"#{k}れても"} |
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
@interface Configuration : NSObject | |
+ (NSString *)name; | |
+ (void)setName:(NSString *)value; | |
+ (BOOL)setting; | |
+ (void)setSetting:(BOOL)value; | |
+ (void)synchronize; | |
@end |