See also
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
app.configure(function() { | |
//. . . | |
app.use(express.bodyParser()); | |
app.use(function(req, res, next) { | |
var data = ''; | |
req.setEncoding('utf8'); | |
req.on('data', function(chunk) { | |
data += chunk; | |
}); | |
req.on('end', function() { |
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
C.SF ={ | |
LoginURL : 'https://login.salesforce.com/services/oauth2/token', | |
Username : process.env.SF_USERNAME, | |
Password : process.env.SF_PASSWORD, | |
ClientID : process.env.SF_CLIENTID, | |
ClientSecret : process.env.SF_CLIENTSECRET, | |
} | |
var options = { | |
//http://www.salesforce.com/us/developer/docs/api_rest/index_Left.htm#CSHID=quickstart_oauth.htm|StartTopic=Content%2Fquickstart_oauth.htm|SkinName=webhelp |
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
function test(callback){ | |
soap.createClient('./partner.wsdl', function(err, client) { | |
console.log('\t\tLogging in on Salesforce...'); | |
client.login({username: C.SF.Username,password: C.SF.Password},function(err,result,raw){ | |
console.log('\t\tDone.'); | |
if(err){ | |
console.log(error); | |
return callback(error); | |
} |
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
var mongoose = require('./index') | |
, TempSchema = new mongoose.Schema({ | |
salutation: {type: String, enum: ['Mr.', 'Mrs.', 'Ms.']} | |
}); | |
var Temp = mongoose.model('Temp', TempSchema); | |
console.log(Temp.schema.path('salutation').enumValues); | |
var temp = new Temp(); | |
console.log(temp.schema.path('salutation').enumValues); |
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
// to get the current latitude and longitude from browser | |
// credits https://github.com/arunisrael/angularjs-geolocation | |
'use strict'; | |
angular.module('geolocation',[]).constant('geolocation_msgs', { | |
'errors.location.unsupportedBrowser':'Browser does not support location services', | |
'errors.location.notFound':'Unable to determine your location', | |
}); | |
angular.module('geolocation') |
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 Boolean isThereABatchRunningWithName(String batchClassName){ | |
List<AsyncApexJob> jobs = [Select ApexClass.Name,JobType From AsyncApexJob | |
Where Status IN ('Queued','Processing','Preparing') | |
and ApexClass.Name = :batchClassName limit 1]; | |
return jobs.isEmpty()==false; | |
} |
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 String getStackTraceFromException(Exception e){ | |
return e.getStackTraceString().replace('\n',' | ')+' | '+e.getMessage().replace('\n',' '); | |
} |
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
<html> | |
<head> | |
<style> | |
.active-link{ | |
font-weight: bold; | |
color: blue; | |
cursor: pointer; | |
} | |
</style> |
OlderNewer