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
BOOL isRunning(NSString *bundleID) | |
{ | |
BKSSystemService *systemService = [[BKSSystemService alloc] init]; | |
pid_t pid = [systemService pidForApplication:bundleID]; | |
[systemService release]; | |
return pid != 0; | |
} |
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
#import <AVFoundation/AVFoundation.h> | |
@interface AVCaptureStillImageOutput (PrivateAPI) | |
- (void)captureStillImageSurfaceAsynchronouslyFromConnection:(AVCaptureConnection *)connection completionHandler:(void (^)(IOSurfaceRef photoSurfaceRef, NSInteger photoSurfaceSize, IOSurfaceRef photoPreviewSurfaceRef, NSInteger photoPreviewSurfaceSize, CFDictionaryRef photoProperties))completionHandler; | |
@end |
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
#import <UIKit/UIKit.h> | |
@interface UIImage (FlatImageWithColor) | |
- (UIImage *)_flatImageWithColor:(UIColor *)color; | |
@end | |
@implementation UIImage (FlatImageWithColor) | |
- (UIImage *)_flatImageWithColor:(UIColor *)color { | |
UIImage *flatImage = nil; |
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
#import <Foundation/Foundation.h> | |
// ApplePushService.framework | |
@interface APSMessage : NSObject | |
- (id)initWithTopic:(NSString *)topic userInfo:(NSDictionary *)userInfo; | |
@end | |
@interface APSIncomingMessage : APSMessage | |
@end |
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
static void setLandscapeProximityEnabled(BOOL enabled) | |
{ | |
UIDevice *dev = [UIDevice currentDevice]; | |
if (enabled) { | |
[dev _setExpectsFaceContactInLandscape:YES]; | |
dev.proximityMonitoringEnabled = YES; | |
} else { | |
dev.proximityMonitoringEnabled = NO; | |
[dev _setExpectsFaceContactInLandscape:NO]; | |
} |
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
/* Advanced Adjustments */ | |
/* Star background + Transparent UI */ | |
#page, #nav-drawer { | |
background-image: url("https://i.ytimg.com/vi/EZ7la-hMNuk/maxresdefault.jpg"); | |
} | |
body, #page { | |
background-color: rgba(0,0,0,0) !important; | |
} |
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
$(function() { | |
if (top.location.hostname === 'elearning.ict.mahidol.ac.th') { | |
var activeCourses = [ "ITCS343", "ITCS381", "ITCS323", "ITCS335", "ITLG202", "ITCS241", "ITID274" ]; // for example | |
var courses = $(".block_course_list > .content > .list").children(); | |
$.each(courses, function() { | |
var title = $(this).text().split(" - ")[0]; | |
if ($.inArray(title, activeCourses) == -1) | |
$(this).hide(); | |
}); | |
} |
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
#import <UIKit/UIKit.h> | |
#import <CoreFoundation/CoreFoundation.h> | |
#import <CoreGraphics/CoreGraphics.h> | |
#import <CoreText/CoreText.h> | |
@interface EmojiUtilities : NSObject | |
+ (CFMutableCharacterSetRef)emojiCharacterSet; | |
+ (BOOL)containsEmoji:(NSString *)emoji; | |
@end |
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
$(function() { | |
if (top.location.hostname === "mycourses.ict.mahidol.ac.th") { | |
var events = $(".calendar_event_group"); | |
var eventLinks = $(".calendar_event_group > a"); | |
$.each(events, function() { | |
var link = this.childNodes[0]; | |
if (typeof link.text != 'undefined' && link.text.startsWith("Cancel")) { | |
this.style.backgroundColor = this.style.borderColor = "#ffb3b3"; | |
var day = this.parentElement.parentElement.childNodes[0].childNodes[0].text; | |
$.each(eventLinks, function() { |
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
$(function() { | |
if (top.location.hostname === "mycourses.ict.mahidol.ac.th") { | |
var username = document.getElementById("username"); | |
var password = document.getElementById("password"); | |
if (username != null && password != null) { | |
username.value = "uxx88yyy"; | |
password.value = "password"; | |
document.forms["login"].submit(); | |
} | |
} |
OlderNewer