Skip to content

Instantly share code, notes, and snippets.

View tyoshikawa1106's full-sized avatar
🇯🇵
TOKYO

Taiki Yoshikawa tyoshikawa1106

🇯🇵
TOKYO
View GitHub Profile
@tarot
tarot / myfirstltng.cmp
Last active September 22, 2015 08:11
<aura:component implements="force:appHostable" controller="myfirstltngController">
<aura:attribute name="account" type="Account"/>
<aura:handler name="init" action="{!c.init}" value="{!this}"/>
{!v.account.Name}
<button onclick="{!c.save}">click</button>
</aura:component>
{
"name": "retrieve_folders",
"dependencies": {
"bluebird": "^2.4.2",
"dotenv": "^0.4.0",
"jsforce": "^1.3.1",
"lodash": "^2.4.1",
"underscore": "^1.7.0",
"unzip": "^0.1.11"
}
@peterknolle
peterknolle / AutocompleteController.cls
Last active December 29, 2022 17:11
Lightning Autocomplete Component
public class AutocompleteController {
@AuraEnabled
public static List<sObject> getSuggestions(String sObjectType, String term, String fieldsToGet, Integer limitSize) {
// could add in logic to remove possible duplicate fields
String fields = fieldsToGet.length() > 0 ? ',' + fieldsToGet : '';
String soql =
' SELECT Name, Id ' + String.escapeSingleQuotes(fields) +
' FROM ' + String.escapeSingleQuotes(sObjectType) +
' WHERE Name Like \'' + String.escapeSingleQuotes(term) + '%\'' +
@jeffdonthemic
jeffdonthemic / AddToCart.evt
Last active December 29, 2022 17:11
Salesforce1 Lightning Demo for Spring '15
<aura:event type="APPLICATION" description="Add to cart event.">
<aura:attribute name="product" type="Product__c"/>
</aura:event>
//Create a resource mapping
// - * wildcard must be preceded and followed by a '/' unless * is end character
// - resource must start with '/'
// - one mapping per class
// - class must be global
@RestResource(urlMapping='/languages/*')
global with sharing class LanguageService {
// ROUTES:
@peterknolle
peterknolle / JoinController.cls
Created May 7, 2014 02:20
Google Visualization API Joins in Visualforce
public with sharing class JoinController {
// The from and through dates are hard-coded for simplicity's sake.
// Should change to parameters or input or something else.
public String getPageViewsJson() {
List<Page_View_Summary__c> pvs = [
SELECT Date__c, Number_of_Views__c
FROM Page_View_Summary__c
WHERE Date__c >= 2014-04-01
AND Date__c <= 2014-04-30
public class Governor1{
private static final integer ONE = 1;
private static final String ONE_MESSAGE = 'ええぃ!セールスフォースのガバナは化け物か!';
private Governor1(){}
public static void check(){
Governor1.check(false);
}
@peterknolle
peterknolle / remoteObjectNodes.page
Last active August 7, 2018 09:07
Visualforce Remote Objects and jsTree jQuery plugin
<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
<!DOCTYPE html>
<html lang="ja">
<head>
<meta charset="UTF-8">
<title>todo</title>
<script type="text/javascript"
src="http://codeorigin.jquery.com/jquery-1.10.2.min.js">
</script>
<script type="text/javascript"
src="http://cdnjs.cloudflare.com/ajax/libs/knockout/2.3.0/knockout-min.js">
<apex:page standardController="Lead">
<style>
.fieldempty
{
background-color: yellow;
}
.fieldpopulated
{
background-color: white;