Loosely ordered with the commands I use most towards the top. Sublime also offer full documentation.
Ctrl+C | copy current line (if no selection) |
Ctrl+X | cut current line (if no selection) |
Ctrl+⇧+K | delete line |
Ctrl+↩ | insert line after |
function fetchWithAuth(url, options) { | |
var accessToken = '<your access token>'; | |
if (!options) { | |
options = {}; | |
} | |
if (!options.headers) { | |
options.headers = new Headers(); | |
} | |
options.headers.append('Authorization', 'Bearer ' + accessToken); | |
return fetch(url, options); |
import { LightningElement, track, wire, api } from 'lwc'; | |
export default class DynamicFields extends LightningElement { | |
@api recordId; | |
@track fields; | |
@api objectApiName; | |
@wire(getRecord, { recordId: '$recordId', fields: '$fields' }) | |
record; | |
<apex:page > | |
<apex:includeScript value="//cdnjs.cloudflare.com/ajax/libs/jquery/2.1.1/jquery.min.js"/> | |
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.1/css/bootstrap.min.css" /> | |
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.1/js/bootstrap.min.js"></script> | |
<script> | |
var statusList = { | |
'Started': '?', | |
'Pending': 'Pending', | |
'Approved': 'Approved' | |
} |
// refs: http://www.jitendrazaa.com/blog/salesforce/salesforce-rest-api-playground/ | |
function getQueryStringValue (key) { | |
return unescape(window.location.search.replace(new RegExp("^(?:.*[&\\?]" + escape(key).replace(/[\.\+\*]/g, "\\$&") + "(?:\\=([^&]*))?)?.*$", "i"), "$1")); | |
} | |
{!REQUIRESCRIPT ("/soap/ajax/13.0/connection.js")}; | |
var records = {!GETRECORDIDS($ObjectType.Book__c)}; | |
var counter = 0; | |
for(var i=0; i<records.length; i++){ | |
var xmlhttp = new XMLHttpRequest(); |
git config --global alias.lg "log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)<%an>%Creset' --abbrev-commit --date=relative" |
trigger BookTrigger on Book__c (after insert, after update) { | |
BookTriggerHandler handler = new BookTriggerHandler(); | |
if (Trigger.isBefore) { | |
// before trigger logic | |
} else if (Trigger.isAfter) { | |
if (Trigger.isInsert) { | |
// GoogleBooksAPIで書籍の情報を取得 | |
handler.setGoogleBooksInfo(Trigger.new); |
function binSearch(text, searchLen) { | |
var left = 0, right = text.length; | |
var breakPos = left, lastBreakPos = right; | |
while (Math.abs(lastBreakPos - breakPos) > 1) { | |
lastBreakPos = breakPos; | |
breakPos = Math.floor((left+right)/2); | |
if (searchLen < getTextWidth(text.substring(0, breakPos))) | |
right = breakPos - 1; | |
else | |
left = breakPos + 1; |
Loosely ordered with the commands I use most towards the top. Sublime also offer full documentation.
Ctrl+C | copy current line (if no selection) |
Ctrl+X | cut current line (if no selection) |
Ctrl+⇧+K | delete line |
Ctrl+↩ | insert line after |
String table = 'TableName'; // with __c if use Custom Object | |
Map<String, Schema.SObjectType> m = Schema.getGlobalDescribe() ; | |
Schema.SObjectType s = m.get(table) ; | |
Schema.DescribeSObjectResult r = s.getDescribe() ; | |
Map<String, Schema.SObjectField> fields = r.fields.getMap() ; | |
string soql = ''; | |
for (String fieldName : fields.keyset()) { | |
if (soql != '') { | |
soql += ', '; | |
} |
global with sharing class CommonClass { | |
global List<Object> selectAllFromTable(String objectName, String whereCondition, String order, String limit1){ | |
String query = selectAllQuery(objectName, whereCondition); | |
query += ' ORDER BY '+order+' LIMIT '+limit1; | |
try { | |
return database.query(query); | |
} catch (QueryException e){ | |
//perform exception handling | |
System.debug('failed to selectAllFromTable'); |