This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <script src="//polymerstaticfiles.appspot.com/bower_components/webcomponentsjs/webcomponents.js"></script> | |
| <link rel="import" href="//polymerstaticfiles.appspot.com/bower_components/font-roboto/roboto.html"> | |
| <link rel="import" href="//polymerstaticfiles.appspot.com/bower_components/core-header-panel/core-header-panel.html"> | |
| <link rel="import" href="//polymerstaticfiles.appspot.com/bower_components/core-toolbar/core-toolbar.html"> | |
| <link rel="import" href="//polymerstaticfiles.appspot.com/bower_components/paper-tabs/paper-tabs.html"> | |
| <meta name="viewport" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| global with sharing class CSVIterator implements Iterator<String>, Iterable<String> { | |
| private String csvData; | |
| private String rowDelimiter; | |
| public CSVIterator(String fileData, String rowDelimiter) { | |
| this.csvData = fileData; | |
| this.rowDelimiter = rowDelimiter; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # -*- coding: utf-8 -*- | |
| from django.http import HttpResponsePermanentRedirect | |
| from google.appengine.api import users | |
| def login_required(handler_method): | |
| u"""Django の Class-based view 用デコレータ | |
| Example: | |
| class MyView(View): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # -*- coding: utf-8 -*- | |
| import json | |
| from django.core.serializers.json import DjangoJSONEncoder | |
| from django.http import HttpResponse | |
| class JSONResponseMixin(object): | |
| """ | |
| A mixin that can be used to render a JSON response. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <link rel="import" href="/bower_components/polymer/polymer.html"> | |
| <polymer-element name="github-ribbon" attributes="user repo"> | |
| <template> | |
| <style> | |
| a { | |
| background:#000; | |
| color:#fff; | |
| text-decoration:none; | |
| font-family:arial,sans-serif; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public static void capitalize(String str){ | |
| List<String> words = str.split(' '); // 単語に分ける | |
| List<String> capitalizedWords = new List<String>(); | |
| for (String word : words) { | |
| capitalizedWords.add(word.capitalize()); | |
| } | |
| return String.join(capitalizedWords, ' '); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?xml version="1.0" encoding="UTF-8"?> | |
| <CustomTab xmlns="http://soap.sforce.com/2006/04/metadata"> | |
| <auraComponent>MyLightningComponent</auraComponent> | |
| <label>Lightningタブ</label> | |
| <mobileReady>false</mobileReady> | |
| <motif>Custom9: 稲妻</motif> | |
| </CustomTab> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| {!REQUIRESCRIPT('/soap/ajax/33.0/connection.js')}; | |
| var ids = {!GETRECORDIDS($ObjectType.Lead)}, | |
| idsStr = ids.toString().replace(/,/g, "','"); | |
| query = "SELECT Name FROM Lead WHERE Id IN ('" + idsStr + "')", | |
| records = sforce.connection.query(query).getArray('records'); | |
| if (records.length === 0) { | |
| alert('1つ以上選択してください'); | |
| } else { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // すべてのSObjectを取得する場合 | |
| Map<String, Schema.SObjectType> sMap = Schema.getGlobalDescribe(); | |
| // SObjectの種類を指す | |
| Schema.SObjectType eventType = Event.SObjectType; | |
| // または、インスタンスから取得 | |
| SObject sObj = new Account(); | |
| Schema.SObjectType accountType = sObj.getSObjectType(); | |
| // Schema.DescribeSObjectResultというクラスを経由する |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * 添付ファイルつきのメールを送信するサンプル | |
| */ | |
| // メール | |
| Messaging.SingleEmailMessage mail = new Messaging.SingleEmailMessage(); | |
| mail.setToAddresses(new List<String> { '[email protected]' }); | |
| mail.setSubject('Mail Subject'); | |
| mail.setPlainTextBody('Mail body'); |