Skip to content

Instantly share code, notes, and snippets.

View chrisl8888's full-sized avatar
πŸ’­
🏈

Chris Lee chrisl8888

πŸ’­
🏈
View GitHub Profile
@chrisl8888
chrisl8888 / custom-settings.apex
Created August 19, 2015 20:53
Example of custom settings
// You name custom settings to "MyApp Settings"
MyApp_Settings__c settings = MyApp_Settings__c.getInstance('foo');
Id appId = Id.valueOf(settings.appId__c);
@chrisl8888
chrisl8888 / hello-world.apxc
Created August 10, 2015 19:49
Hello World Class
public class HelloWorld {
private String defaultMsg = 'Hello Foo!';
private String msg = defaultMsg;
public HelloWorld(String message) {
this.say(message);
}
public void say(String message) {
this.msg = message;
System.debug(this.msg);
Messaging.SingleEmailMessage mail = new Messaging.SingleEmailMessage();
Contact recipient = [SELECT id, firstname FROM Contact LIMIT 1];
EmailTemplate et = [SELECT id FROM EmailTemplate WHERE developerName = 'MyTemplate'];
mail.setSenderDisplayName('Your Loving Administrator');
mail.setTargetObjectId(recipient.id); // Specify who the email should be sent to.
mail.setTemplateId(et.id);
{
"rules": {
"indent": [2, 2],
"no-unused-vars": [2, {"vars": "local", "args": "after-used"}],
"no-alert": 1
},
"env": {
"browser": true
}
}
@chrisl8888
chrisl8888 / Update-Triggers.apxc
Last active August 29, 2015 14:25
Apex Trigger.isInsert() and trigger.isUpdate() in Salesforce from http://www.infallibletechie.com/2012/05/triggerisinsert-and-triggerisupdate-in.html
rigger memberInviteNotify on Member__c (after insert,after update)
{
for(Member__c member:trigger.New)
{
String[] toAddresses = new String[] {member.E_Mail_Id__c};
String messageBody;
Messaging.SingleEmailMessage mail = new Messaging.SingleEmailMessage();
mail.setToAddresses(toAddresses);
//Email invitation
@chrisl8888
chrisl8888 / macos-password.sh
Last active August 29, 2015 14:25
Find the Wi-Fi Password for Your Current Network with the Command Line - http://j.mp/1gCwm0g
security find-generic-password -ga labnol | grep password
@chrisl8888
chrisl8888 / README.md
Last active August 29, 2015 14:24
Install canon printer on ubuntu
@chrisl8888
chrisl8888 / send-single-email.apxc
Last active August 29, 2015 14:24
Create single email with apex
Messaging.SingleEmailMessage mail = new Messaging.SingleEmailMessage();
String[] toAddresses = new List<String>();
toAddresses.add('email@example.com');
mail.setToAddresses(toAddresses);
mail.setSubject('Email from: '+System.URL.getSalesforceBaseUrl().toExternalForm());
mail.setPlainTextBody('Email body!');
Messaging.sendEmail(new Messaging.SingleEmailMessage[] { mail })
@chrisl8888
chrisl8888 / notes.md
Created June 3, 2015 21:18
Future Insights 2015 - Reactjs, death of css @collinmegell

React inspired by D3

  • When data changes rerender in dom
  • Mithril was another framework that uses Diff'ing

Recomputing styles

e.g. padding: foo === bar ? 5px : 10px

  • CSS has limitations and we have to currently compile css
@chrisl8888
chrisl8888 / notes.md
Last active August 29, 2015 14:22
Future Insights 2015 - Web Components with Matt Shull

Web Components

  • Web components are custom elements
  • Uses HTML, CSS, and JavaScript
  • It's like calculus
    • Allow for abstraction of elements
  • An example would be an image slider

Web components has many parts

  • Templates
  • Shadow DOM