Skip to content

Instantly share code, notes, and snippets.

View xjsender's full-sized avatar
🎯
Focusing

Hao Liu xjsender

🎯
Focusing
View GitHub Profile
@xjsender
xjsender / ApexOrg2Org
Last active June 13, 2023 04:03 — forked from richardvanhook/ApexOrg2Org
Apex SOAP Login
/*
======================================================================
The following apex code demonstrates logging into another salesforce
org via the SOAP/XML web service api and then using session id to
query the standard REST API as well as the Chatter REST API.
To run this code, simply copy and paste into execute anonymous,
then replace the value of the first three variables accordingly.
NOTES:
(1) You'll need to create a remote site setting for both the login
git init # 初始化本地git仓库(创建新仓库)
git config --global user.name "xxx" # 配置用户名
git config --global user.email "xxx@xxx.com" # 配置邮件
git config --global color.ui true # git status等命令自动着色
git config --global color.status auto
git config --global color.diff auto
git config --global color.branch auto
git config --global color.interactive auto
git clone git+ssh://git@192.168.53.168/VT.git # clone远程仓库
git status # 查看当前版本状态(是否修改)
@xjsender
xjsender / Judge Variable Type.js
Last active August 29, 2015 14:07
通过该模块可以动态的判断JS变量的类型
[
'Null',
'Undefined',
'Object',
'Array',
'String',
'Number',
'Boolean',
'Function',
'RegExp',
@xjsender
xjsender / remoteObjectNodes.page
Last active August 29, 2015 14:16 — forked from peterknolle/remoteObjectNodes.page
JSTree sample used in SFDC
<apex:page >
<!-- download the jstree from jstree.com and upload the dist directory as a static resource -->
<link href="{!URLFOR($Resource.jsTree, 'themes/default/style.min.css')}" rel="stylesheet" />
<script src="{!URLFOR($Resource.jsTree, 'libs/jquery.js')}"></script>
<script src="{!URLFOR($Resource.jsTree, 'jstree.min.js')}"></script>
<script src="{!URLFOR($Resource.jsTree, 'jstree.min.js')}"></script>
<!--
Change the remoteObjectModel name="Account and
@xjsender
xjsender / AllObjects.apex
Last active August 29, 2015 14:17
Get All Sobjects
List<String> sObjects = new List<String>();
for (SObjectType st : Schema.getGlobalDescribe().values()) {
sObjects.add(st.getDescribe().getName());
}
@xjsender
xjsender / RollupSummaryUtils.cls
Created May 15, 2015 02:20
RollupSummaryUtils
public class RollupSummaryUtils {
public static void rollupSummary(List<Sobject> records,
String parentLookupField,
List<RollupSummaryUtils.FieldDefinition> fieldDefs,
String filter) {
Set<Id> parentIds = new Set<Id>();
for (Sobject so : records) {
if (so.get(parentLookupField) != null) {
parentIds.add((Id)so.get(parentLookupField));
@xjsender
xjsender / Generate Table By Snippets Directory.py
Last active August 29, 2015 14:23
Generate Table By Snippets Directory
import sublime
import os
import json
from .salesforce import xmltodict
snippet_dir = sublime.packages_path() + "/haoide/config/snippets"
trs = []
for dirpath, dirnames, filenames in os.walk(snippet_dir):
for filename in filenames:
print (filename)
<!--
We will create a family tree using just CSS(3)
The markup will be simple nested lists
-->
<style>
/*Now the CSS*/
* {margin: 0; padding: 0;}
.tree ul {
padding-top: 20px; position: relative;
@xjsender
xjsender / Visualforce PDF Landscape.md
Last active December 24, 2015 10:06
Visualforce PDF Landscape

Add page size for PDF rotation below v28.0

@page {
    size: landscape;
}

After v28.0, use below method:

@xjsender
xjsender / Bootstrap3 Progress-bar.css
Created July 27, 2015 02:45
Bootstrap3 Progress-bar
/* boostrap progressbar */
.sr-only {
position: absolute;
width: 1px;
height: 1px;
padding: 0;
margin: -1px;
overflow: hidden;
clip: rect(0,0,0,0);