Skip to content

Instantly share code, notes, and snippets.

View xgeek-net's full-sized avatar

Xiaoan Lin xgeek-net

View GitHub Profile
@xgeek-net
xgeek-net / debuglog.log
Last active January 9, 2017 02:24
Apex Batch debuglog
/******* 1ST TRANSACTION *********/
CODE_UNIT_STARTED|[EXTERNAL]|01pO0000000Nans|SampleBatch
USER_DEBUG|[11]|DEBUG|>>> execute start at 2017/01/08 04:44:35
USER_DEBUG|[18]|DEBUG|>>> execute end at 2017/01/08 04:44:40
CODE_UNIT_FINISHED|SampleBatch
/******* 2ND TRANSACTION *********/
CODE_UNIT_STARTED|[EXTERNAL]|01pO0000000Nans|SampleBatch
USER_DEBUG|[11]|DEBUG|>>> execute start at 2017/01/08 04:44:40
USER_DEBUG|[18]|DEBUG|>>> execute end at 2017/01/08 04:44:45
@xgeek-net
xgeek-net / Force CLI.shell
Created November 9, 2016 06:16
Force CLI ヘルプ
Usage: force <command> [<args>]
Available commands:
login # Force.comにログイン
logout # Force.comにログアウト
logins # 現在ログインしているアカウントリストの表示
active # Force.comアカウントの表示又は有効化
whoami # 有効化されているアカウント情報の表示
describe # オブジェクトdescribe(リスト)情報の取得
sobject # 標準&カスタムオブジェクトの管理
@xgeek-net
xgeek-net / Salesforce DX.shell
Created November 9, 2016 06:04
Salesforce DX 機能概要
$ sfdx force --help
Additional commands, type "heroku help COMMAND” for more details:
force:apex:exec # Apexコードの実行
force:apex:limits # 現組織のガバナー制限の表示
force:apex:logs # デバッグログの検索・表示
force:apex:report # testrunidからレポートのテスト実行結果の取得
force:apex:test # Apexテストの実行
force:api:limits # 現組織の制限情報の表示
force:bulk:delete # 指定csvファイルからレコードBulk削除
@xgeek-net
xgeek-net / chmod.shell
Created November 8, 2016 03:08
chmod force
$ chmod 770 force
@xgeek-net
xgeek-net / Salesforce DX.shell
Last active November 8, 2016 05:03
Salesforce DX Help
$ sfdx force --help
Additional commands, type "heroku help COMMAND” for more details:
force:apex:exec # execute anonymous apex code
force:apex:limits # display current org's apex governor limits
force:apex:logs # fetch debug logs
force:apex:report # retrieve and report test results for a
# given testrunid
force:apex:test # invoke apex tests
force:api:limits # display current org's limits
@xgeek-net
xgeek-net / Force CLI.shell
Created November 8, 2016 03:06
Force CLI usage
Usage: force <command> [<args>]
Available commands:
login Log in to force.com
logout Log out from force.com
logins List force.com logins used
active Show or set the active force.com account
whoami Show information about the active account
describe Describe the object or list of available objects
sobject Manage standard & custom objects
@xgeek-net
xgeek-net / force cli.shell
Last active November 8, 2016 03:07
Force CLI
$ force login
$ force query "SELECT COUNT() FROM Account"
(44 records)
@xgeek-net
xgeek-net / FacebookApi.java
Created September 30, 2016 03:49
FacebookApi getProfile
public class FacebookApi implements SocialApi{
public String getProfile(String accessToken) {
// Request profile via Facebook api
return 'https://scontent.xx.fbcdn.net/xxxxxx.png';
}
}
@xgeek-net
xgeek-net / SocialApi.java
Created September 30, 2016 03:45
SocialApi interface
public interface SocialApi {
String getProfile(String accessToken);
}
@xgeek-net
xgeek-net / Type.java
Created September 30, 2016 03:43
SocialApi Type
Contact contact = [SELECT Id, Type__c, AccessToken__c FROM Contact LIMIT 1];
System.assertEquals(contact.Type__c, 'Facebook');
String socialType = contact.Type__c + 'Api';
Type t = Type.forName(socialType);
SocialApi api = (SocialApi)t.newInstance();
String profile = api.getProfile(contact.AccessToken__c);
System.assertEquals(profile, 'https://scontent.xx.fbcdn.net/xxxxxx.png');