This file contains 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
require 'restforce' | |
# set default org with sfdx | |
# sfdx config set target-org=<some username or org alias> | |
# grab the access token & instance url from the default scratch org using sfdx | |
org = JSON.parse(`sfdx org display --json`) | |
client = Restforce.new( | |
oauth_token: org['result']['accessToken'], |
This file contains 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
var venueCheckins = function(access_token) { | |
return new Promise(function(resolve, reject) { | |
request('https://api.untappd.com/v4/thepub/local?limit=25&lat=61.146283&lng=-149.878679&access_token='+access_token, function (error, response, body) { | |
if (!error && response.statusCode == 200) { | |
var results = JSON.parse(body); | |
var checkins = []; | |
// do magic | |
resolve(checkins); | |
} else { | |
reject(error); |
This file contains 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
var http = require('http'); | |
var request = require('request'); | |
var moment = require("moment"); | |
var crypto = require('crypto'); | |
var apiToken = 'MY-TOKEN'; | |
var apiSecret = 'MY-SECRET'; | |
var generateSession = function(userName, sessionName) { | |
var relativeUrl = "/services/api/sts/GenerateSession/"+userName+"/"+sessionName; |
This file contains 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 AngularDemoController { | |
// hardcode an account id for demo purposes | |
static String accountId = '0017000001CwYz9'; | |
global static String getAccount() { | |
return JSON.serialize([select name, billingstreet, | |
billingcity, billingstate, billingpostalcode | |
from account where id = :accountId][0]); | |
} |
This file contains 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
package main | |
import ( | |
"fmt" | |
"log" | |
"github.com/nimajalali/go-force/force" | |
"github.com/nimajalali/go-force/sobjects" | |
) |
This file contains 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
var githubapi = require("github"), | |
async = require("async"), | |
AWS = require('aws-sdk'), | |
secrets = require('./secrets.js'); | |
// the 'handler' that lambda calls to execute our code | |
exports.handler = function(event, context) { | |
// config the sdk with our credentials | |
// http://docs.aws.amazon.com/AWSJavaScriptSDK/guide/node-configuring.html |
This file contains 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
{ "accessKeyId": "akid", "secretAccessKey": "secret", "region": "us-east-1" } |
This file contains 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
'use strict'; | |
var app = angular.module('app'); | |
app.controller('AccountDetailCtrl', function($scope, $routeParams, Account) { | |
$scope.account = Account.get({id:$routeParams.id}); | |
$scope.mode = 'display'; | |
$scope.edit = function() { |
This file contains 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
<apex:component controller="ContactListViewController"> | |
<apex:attribute name="listViewName" type="String" required="true" | |
description="The name of the listview." assignTo="{!listName}"/> | |
<apex:enhancedList height="400" rowsPerPage="25" id="ContactList" | |
listId="{!listId}" rendered="{!listId != null}" /> | |
<apex:outputText rendered="{!listId == null}" value="Could not find requewed ListView: '{!listName}'. Please contact your administrator."/> | |
</apex:component> |
This file contains 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
<aura:application> | |
<aura:handler event="forcelogic2:BlogRequireJSEvent" action="{!c.initJS}"/> | |
<aura:registerEvent type="forcelogic2:BlogRequireJSEvent" name="requireJSEvent"/> | |
<aura:handler name="init" value="{!this}" action="{!c.doInit}" /> | |
<div id="afterLoad">Old value</div> | |
</aura:application> |