Skip to content

Instantly share code, notes, and snippets.

CREATE TABLE `tbl_activityfeed` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`activitytype` varchar(10) DEFAULT NULL,
`userid` int(11) DEFAULT NULL,
`commentpageid` int(11) DEFAULT NULL,
`goal_id` int(11) DEFAULT NULL,
`activity_date` timestamp NULL DEFAULT NULL,
PRIMARY KEY (`id`)
)
.sprite-photoupload-roll{ background-position: 0 0; width: 100px; height: 25px; }
.sprite-photoupload{ background-position: 0 -30px; width: 100px; height: 25px; }
.sprite-videoupload-roll{ background-position: 0 -60px; width: 100px; height: 25px; }
.sprite-videoupload{ background-position: 0 -90px; width: 100px; height: 25px; }
.sprite-weblink-roll{ background-position: 0 -120px; width: 100px; height: 25px; }
.sprite-weblink{ background-position: 0 -150px; width: 100px; height: 25px; }
import java.io.*;
import java.util.Arrays;
import java.util.ArrayList;
class FileRead
{
public static void main(String args[])
{
try{
FileInputStream fstream = new FileInputStream("textfile.txt");
+(void)getCellContacts:(void (^)(NSArray *contactArray))successBlock {
ABAddressBookRef myAddressBook = ABAddressBookCreate();
ABAddressBookRequestAccessWithCompletion(myAddressBook, ^(bool granted, CFErrorRef error) {
NSArray *allPeople = (__bridge NSArray *)ABAddressBookCopyArrayOfAllPeople(myAddressBook);
NSMutableArray *contactList = [[NSMutableArray alloc]initWithCapacity:[allPeople count]];
[allPeople enumerateObjectsUsingBlock:^(id record, NSUInteger idx, BOOL *stop) {
CFTypeRef phoneProperty = ABRecordCopyValue((__bridge ABRecordRef)record, kABPersonPhoneProperty);
NSArray *phones = (__bridge NSArray *)ABMultiValueCopyArrayOfAllValues(phoneProperty);
-(void)sendSMSToRecipients:(NSArray *)recipientArray SMSString:(NSString *)smsString intoVC:(UIViewController *)vc {
_vc = vc;
MFMessageComposeViewController *controller = [[MFMessageComposeViewController alloc] init];
if([MFMessageComposeViewController canSendText])
{
controller.body = smsString;
controller.recipients = recipientArray;
controller.messageComposeDelegate = self;
[vc presentViewController:controller animated:YES completion:^{
DUETSHTTPClient *httpClient = [DUETSHTTPClient sharedHTTPClient];
NSMutableURLRequest *request = [httpClient requestWithMethod:@"POST"
path:@"/tokens"
parameters:params];
AFJSONRequestOperation *operation = [[AFJSONRequestOperation alloc] initWithRequest:request];
[operation setCompletionBlockWithSuccess:^(AFHTTPRequestOperation *operation, id responseObject) {
if ([self validateRequest:operation.response]) {
}
#import "UIImage+H568.h"
#include <objc/runtime.h>
@implementation UIImage (H568)
+ (void)load {
if ((UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone) &&
([UIScreen mainScreen].bounds.size.height > 480.0f)) {
method_exchangeImplementations(class_getClassMethod(self, @selector(imageNamed:)),
class_getClassMethod(self, @selector(imageNamedH568:)));
if ([SLComposeViewController isAvailableForServiceType:SLServiceTypeTwitter]) {
SLComposeViewController *tweetSheet = [SLComposeViewController composeViewControllerForServiceType:SLServiceTypeTwitter];
[tweetSheet addImage:image];
[tweetSheet setInitialText:[NSString stringWithFormat:@"%@ %@", kSHARETEXT, self.filterName]];
tweetSheet.completionHandler = ^(SLComposeViewControllerResult result) {
switch (result) {
case SLComposeViewControllerResultCancelled:
[Flurry logEvent:@"Share to twitter - cancelled"];
break;
case SLComposeViewControllerResultDone:
[self.navigationController.navigationBar setBackgroundImage:[UIImage new] forBarMetrics:UIBarMetricsDefault];
self.navigationController.navigationBar.shadowImage = [UIImage new];
self.navigationController.navigationBar.translucent = YES;
self.navigationController.view.backgroundColor = [UIColor clearColor];
DROP TRIGGER delete_till_max;
CREATE TRIGGER delete_till_max INSERT ON recents WHEN (select count(*) from recents)>49
BEGIN
DELETE FROM recents WHERE recents.id IN (SELECT recents.id FROM recents ORDER BY recents.id limit (select count(*) -49 from recents ));
END