Skip to content

Instantly share code, notes, and snippets.

View palaniraja's full-sized avatar

palaniraja palaniraja

View GitHub Profile
@palaniraja
palaniraja / Testflightlog2console.js
Created December 15, 2011 07:46
Testflightapp log all session log to browser console
var elem = document.getElementsByClassName('log');
for (i=0;i<elem.length;i++){
console.log(elem[i].innerText);
}
@palaniraja
palaniraja / attachment.m
Created December 22, 2011 12:32
attaching binary data to Salesforce attachment obj
ZKSObject *attachment = [ZKSObject withType:@"Attachment"];
[attachment setFieldValue:[NSString stringWithFormat:@"Nameofyourattachment%@.png", [NSDate date]] field:@"Name"];
[attachment setFieldValue:@"a07M0000000FV5VIAW" field:@"ParentId"];
NSData *cSign = UIImagePNGRepresentation([UIImage imageNamed:@"signature.png"]);
[attachment setFieldValue:[cSign base64EncodedString] field:@"Body"];
[[FDCServerSwitchboard switchboard] create:[NSArray arrayWithObject:attachment] target:self selector:@selector(saveAttachmentToSFResult:error:context:) context:attachment];
@palaniraja
palaniraja / createobj.m
Created December 22, 2011 12:04
Create new record/ add new obj in Salesforce
ZKSObject *sfobj = [[ZKSObject alloc] initWithType:@"Your_custom_object__c"] ;
[sfobj setType:@"Your_custom_object__c"];
[sfobj setFieldValue:@"Air Conditioning System" field:@"Name"];
[sfobj setFieldValue:@"PAL-008" field:@"Service_code__c"];
[sfobj setFieldValue:@"Spot" field:@"Service_Status__c"];
[sfobj setFieldValue:@"a07M0000000FV5VIAW" field:@"child_of_another_custom_object__c"];
@palaniraja
palaniraja / updateObj.m
Created December 22, 2011 12:10
update sf obj/rec in salesforce
ZKSObject *sfobj = [[ZKSObject alloc] initWithType:@"Your_custom_object__c"] ;
[sfobj setType:@"Your_custom_object__c"];
[sfobj setFieldValue:@"a0FM0000000XrKcMAK" field:@"Id"];
[sfobj setFieldValue:@"PAL-008" field:@"Service_code__c"];
[sfobj setFieldValue:@"Room heating system" field:@"Name"]; //update the field value required
[sfobj setFieldValue:@"Maintenance" field:@"Service_Status__c"];
[sfobj setFieldValue:@"a07M0000000FV5VIAW" field:@"child_of_another_custom_object__c"];
[[FDCServerSwitchboard switchboard] update:[NSArray arrayWithObject:sfobj] target:self selector:@selector(updatedObjectResult:error:context:) context:nil];
@palaniraja
palaniraja / deleteObj.m
Created December 22, 2011 12:14
delete / undelete obj from sf
NSString *id2Del = @"a0BM0000001uUrY";
[[FDCServerSwitchboard switchboard] delete:[NSArray arrayWithObject:id2Del] target:self selector:@selector(deleteObjectResult:error:context:) context:nil];
//To undelete the deleted obj. only if available as per Salesforce norms
[[FDCServerSwitchboard switchboard] unDelete:[NSArray arrayWithObject:id2Del] target:self selector:@selector(deleteObjectResult:error:context:) context:nil];
@palaniraja
palaniraja / getObjects.m
Created December 22, 2011 12:25
Get record(s)/obj(s) from salesforce
NSString *getCasesSQL = [NSString stringWithFormat:@"SELECT id, Site__r.Name FROM Case WHERE id = '%@'", @"a0FM0000000XrKcMAK"];
[[FDCServerSwitchboard switchboard] getCasesSQL target:self selector:@selector(getCasesSiteInfoResult:error:context:) context:nil];
/*asynchronously called when the objects are fetched from Salesforce*/
- (void)getCasesSiteInfoResult:(ZKQueryResult *)result error:(NSError *)error context:(id)context{
@palaniraja
palaniraja / ObsidianCode.dvtcolortheme
Created February 16, 2012 10:57
xcode4 theme ObsidianCode with some customization for console/fonts
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>DVTConsoleDebuggerInputTextColor</key>
<string>1 1 1 1</string>
<key>DVTConsoleDebuggerInputTextFont</key>
<string>Menlo-Bold - 12.0</string>
<key>DVTConsoleDebuggerOutputTextColor</key>
<string>1 1 1 1</string>
@palaniraja
palaniraja / Solarize Dark.dvtcolortheme
Created February 26, 2012 14:31
Solarize Dark - XCode 4 theme with Font size 13
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>DVTConsoleDebuggerInputTextColor</key>
<string>1 1 1 1</string>
<key>DVTConsoleDebuggerInputTextFont</key>
<string>Menlo-Bold - 12.0</string>
<key>DVTConsoleDebuggerOutputTextColor</key>
<string>1 1 1 1</string>
@palaniraja
palaniraja / quickfix.js
Created March 10, 2012 08:42
Fixing the osx lion ui for Google reader - https://github.com/aziz/Google-Reader-Lion-UI
/*
1. Install https://github.com/aziz/Google-Reader-Lion-UI as userscript
2. Run the below snippet in your console
* Tested on Chrome
*/
document.getElementById('gbx3').style.display="none";
document.getElementById('gbzw').style.display="none";
document.getElementById('gbx1').style.display="none";
@palaniraja
palaniraja / SonOfObsidian2.xml
Created March 19, 2012 05:48
SonOfObsidian2 - Customized version of SonOfObsidian color scheme for IntelliJ
<?xml version="1.0" encoding="UTF-8"?>
<scheme name="SonOfObsidian2" version="1" parent_scheme="Default">
<option name="LINE_SPACING" value="1.2" />
<option name="EDITOR_FONT_SIZE" value="14" />
<option name="EDITOR_FONT_NAME" value="Consolas" />
<colors>
<option name="CARET_COLOR" value="ffffff" />
<option name="CARET_ROW_COLOR" value="4e5152" />
<option name="INDENT_GUIDE" value="31383b" />
<option name="RIGHT_MARGIN_COLOR" value="" />