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 Foundation | |
import CocoaLumberjack | |
class BeautyLogFormmater: NSObject, DDLogFormatter { | |
public func format(message logMessage: DDLogMessage) -> String? { | |
var logLevel: String = "" | |
switch logMessage.flag { |
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
// Last modify: 2018/09/25 | |
// Data source: http://twtraffic.tra.gov.tw/twrail/TW_Quicksearch.aspx & http://ptx.transportdata.tw/PTX | |
// Please always check if this data is latest before you use | |
[{ | |
"areaName": "台北地區", | |
"stations": [{ | |
"stationId": "1810", | |
"stationName": "福隆" | |
}, { | |
"stationId": "1809", |
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
function draeEverything(){ | |
console.log(ballx); | |
canvasContext.fillStyle = 'black'; | |
canvasContext.fillRect(0,0,canvas.width,canvas.height); | |
canvasContext.fillStyle = 'while'; | |
canvasContext.beginPath(); | |
canvasContext.arc(ballx,bally,10,0,Math.PI*2,true); | |
canvasContext.fill(); | |
} |
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
[self inTransaction:^(FMDatabase *db, BOOL *rollback) { | |
for (NSDictionary *dictionary in array) { | |
count += 1; | |
[db executeUpdate:@"INSERT INTO actors (name,aid) VALUES (?,?)", [dictionary objectForKey:@"name"], [NSNumber numberWithInteger:[[dictionary objectForKey:@"id"] integerValue]]]; | |
} | |
}]; |
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
if ([[[UIDevice currentDevice] systemVersion] floatValue] >= 8.0) { | |
[[UIApplication sharedApplication] registerUserNotificationSettings:[UIUserNotificationSettings settingsForTypes:(UIUserNotificationTypeSound | UIUserNotificationTypeAlert | UIUserNotificationTypeBadge) categories:nil]]; | |
[[UIApplication sharedApplication] registerForRemoteNotifications]; | |
} else { | |
[[UIApplication sharedApplication] registerForRemoteNotificationTypes: | |
(UIUserNotificationTypeBadge | UIUserNotificationTypeSound | UIUserNotificationTypeAlert)]; | |
} |
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
self.adView = [[MPAdView alloc] initWithAdUnitId:@"62a209a4f9764ffcb711b7fac2010d16" size:CGSizeMake(1024, 90)]; | |
self.adView.delegate = self; | |
self.adView.frame = CGRectMake(0, 0, 1024, 90); | |
[self.adView loadAd]; | |
[self.view addSubview:self.adView]; |
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
sudo mv /Applications/LINE.app/Contents/Resources/sounds/Bell.wav /Applications/LINE.app/Contents/Resources/sounds/backup.wav | |
sudo cp /Applications/Skype.app/Contents/Resources/Sounds/Message\ Received\ .m4a /Applications/LINE.app/Contents/Resources/sounds/Bell.wav |