Skip to content

Instantly share code, notes, and snippets.

View tyoshikawa1106's full-sized avatar

Taiki Yoshikawa tyoshikawa1106

View GitHub Profile
@tyoshikawa1106
tyoshikawa1106 / TableChart.page
Created August 7, 2014 14:56
Google Chart Table CSS
<apex:page showHeader="true" sidebar="false">
<head>
<style>
.cssHeaderRow {
background-color: #2A94D6;
}
.cssTableRow {
background-color: #F0F1F2;
}
.cssOddTableRow {
@tyoshikawa1106
tyoshikawa1106 / Gemfile_Memo
Last active October 26, 2023 11:45
Gemfileの意味をメモ
source 'https://rubygems.org'
ruby '2.2.2' (対象のRubyバージョン)
gem 'rails', '4.2.4' (対象のRailsバージョン)
gem 'bootstrap-sass', '~> 3.3.5' (Bootstrapが使える)
gem 'sprockets', '~> 3.3.3' (Railsで依存関係の管理やコンパイルなどをやってくれる)
(開発環境とテスト環境のみ対象)
group :development, :test do
gem 'sqlite3', '1.3.10' (sqlite3をインストール)
public class LeadProcessor implements Database.Batchable<sObject>, Database.Stateful {
/**
* コンストラクタ
*/
public LeadProcessor() {
}
/**
@tyoshikawa1106
tyoshikawa1106 / UrlClassDemo.page
Created February 9, 2015 02:35
Apex URL Class Demo
<apex:page controller="UrlClassDemoController" showHeader="true" sidebar="false">
<!-- Begin Default Content REMOVE THIS -->
<h1>Congratulations</h1>
This is your new Page
<!-- End Default Content REMOVE THIS -->
</apex:page>
public class CalloutClass {
public static HttpResponse getInfoFromExternalService() {
HttpRequest req = new HttpRequest();
req.setEndpoint('http://api.salesforce.com/foo/bar');
req.setMethod('GET');
Http h = new Http();
HttpResponse res = h.send(req);
return res;
}
@tyoshikawa1106
tyoshikawa1106 / 01_unsucribe_layout.html
Last active December 17, 2020 11:05
Pardot Unsucribe Page Sample - 配信停止ページサンプル
<!DOCTYPE html>
<html>
<head>
<base href="" >
<meta charset="utf-8"/>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
<meta name="description" content="%%description%%"/>
<!-- Bootstrap CSS -->
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.5.0/css/bootstrap.min.css" integrity="sha384-9aIt2nRpC12Uk9gS9baDl411NQApFmC26EwAOH8WgZl5MYYxFfc+NcPb1dKGj7Sk" crossorigin="anonymous">
@tyoshikawa1106
tyoshikawa1106 / 01_BookTrigger.trigger
Last active November 17, 2020 03:45
@futureをつかったApexトリガーのサンプル
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);
@tyoshikawa1106
tyoshikawa1106 / handler-sample.txt
Last active June 16, 2020 16:08
Lightning aura:handler
aura:waiting
<aura:handler event="aura:waiting" action="{!c.showSpinner}"/>
aura:valueInit
<aura:handler name="init" value="{!this}" action="{!c.doInit}"/>
aura:valueDestroy
<aura:handler name="destroy" value="{!this}" action="{!c.handleDestroy}"/>
aura:valueChange
@tyoshikawa1106
tyoshikawa1106 / SampleBatch.cls
Created June 29, 2015 04:39
Intriguing Design Pattern for Scheduled APEX
public with sharing class SampleBatch implements Database.batchable<sObject>, Database.Stateful {
public Database.QueryLocator start(Database.BatchableContext BC) {
String query = '';
query += ' SELECT ';
query += ' Id ';
query += ' FROM ';
query += ' Account ';
return Database.getQueryLocator(query);
}
@tyoshikawa1106
tyoshikawa1106 / force:navigateToRelatedList.js
Created March 15, 2015 09:31
force:navigateToRelatedList sample code
gotoRelatedList : function (component, event, helper) {
var relatedListEvent = $A.get("e.force:navigateToRelatedList");
relatedListEvent.setParams({
"relatedListId": "Cases",
"parentRecordId": component.get("v.contact.Id")
});
relatedListEvent.fire();
}