Skip to content

Instantly share code, notes, and snippets.

Avatar

Christophe Coenraets ccoenraets

View GitHub Profile
View server.js
const express = require('express');
const bodyParser = require('body-parser');
const app = express();
const PORT = process.env.PORT || 5000;
app.use(bodyParser.json());
app.use(express.static('www'));
app.get('/property', (req, res) => {
let sql = "SELECT * FROM salesforce.Property__c WHERE Status__c='Available'";
View temp
[
{
"category": "Cat 1",
"questions": [
{
"points": 100,
"question": "q1",
"answer": "a1"
},
{
View SlackOpportunityPublisher.apxc
public with sharing class SlackOpportunityPublisher {
private static final String slackURL = 'YOUR_WEBHOOK_URL';
@InvocableMethod(label='Post to Slack')
public static void postToSlack(List<Id> opportunityId) {
Id oppId = opportunityId[0]; // If bulk, only post first to avoid overloading Slack channel
Opportunity opportunity = [SELECT Name, StageName from Opportunity WHERE Id=:oppId];
Map<String,Object> msg = new Map<String,Object>();
msg.put('text', 'The following opportunity has changed:\n' + opportunity.Name + '\nNew Stage: *'
View property-list.js
import {OnInit} from 'angular2/core';
import {Page, NavController, NavParams} from 'ionic/ionic';
import {PropertyDetailsPage} from '../property-details/property-details';
import {PropertyService} from '../../services/property-service';
@Page({
templateUrl: 'build/pages/property-list/property-list.html'
})
export class PropertyListPage {
View SlackOpportunityPublisher.cls
public with sharing class SlackOpportunityPublisher {
private static final String slackURL = 'YOUR_WEBHOOK_URL';
public class Oppty {
@InvocableVariable(label='Opportunity Name')
public String opptyName;
@InvocableVariable(label='Stage')
public String stage;
}
View gist:bd10c4a7aa77254b43c5
<aura:component controller="CandidateController" implements="force:appHostable">
<ltng:require styles="/resource/slick/slick.css,/resource/slick/slick-theme.css"
scripts="/resource/jquery,/resource/slick/slick.min.js"
afterScriptsLoaded="{!c.doInit}"/>
<aura:attribute name="contacts" type="Contact[]"/>
<div class="carousel">
<aura:iteration items="{!v.contacts}" var="contact">
View gist:68873b949e972188270c
<aura:component implements="force:appHostable">
<ltng:require styles="/resource/leaflet/leaflet.css" />
<ltng:require scripts="/resource/leaflet/leaflet.js"
afterScriptsLoaded="{!c.jsLoaded}" />
<div id="map" class="map"></div>
</aura:component>
View gist:77572ceac547314f514a
IF(ISBLANK(Implemented_Date__c), TODAY() - DATEVALUE(CreatedDate) , Implemented_Date__c - DATEVALUE(CreatedDate) )
@ccoenraets
ccoenraets / SpeakerControllerExtension
Last active Aug 29, 2015
SpeakerControllerExtension
View SpeakerControllerExtension
public class SpeakerControllerExtension {
public blob picture { get; set; }
public String errorMessage { get; set; }
private final Speaker__c speaker;
private ApexPages.StandardController stdController;
public SpeakerControllerExtension(ApexPages.StandardController stdController) {
this.speaker = (Speaker__c)stdController.getRecord();
@ccoenraets
ccoenraets / app.js
Last active Dec 16, 2015
Data Adapters
View app.js
var app = {
findByName: function() {
this.store.findByName($('.search-key').val()).done(function(employees) {
var l = employees.length;
var e;
$('.employee-list').empty();
for (var i=0; i<l; i++) {
e = employees[i];
$('.employee-list').append('<li><a href="#employees/' + e.id + '">' + e.firstName + ' ' + e.lastName + '</a></li>');