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
/* Test Eval */ | |
var eval_string = 'var x = 1;' | |
+ 'if(x >= 1) {' | |
+ ' var y = x * 2;' | |
+ ' if(y==3) { y=3; }' | |
+ '}'; | |
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
public class MergeTool { | |
public static String mustacheMerge(String text, SObject obj) { | |
String p = '\\{\\{([^\\{\\}]*?)\\}\\}'; | |
Pattern patt = Pattern.compile(p); | |
Matcher mat = patt.matcher(text); | |
Boolean foundValue = mat.find(); |
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
/* | |
* Author: Kevin O'Hara | |
* Date: 02/10/2012 | |
* | |
* Description: The Async class aims to circumvent a limitation of asynchronous (@future) | |
* methods in Salesforce. The current @future implementation will only allow for primitives | |
* or collections of primitives to be passed into an @future method. The Async class uses | |
* native JSON serialization/deserialization to allow for passing an SObject, or List<SObject> | |
* into an asynchronous method for DML operations. A helper method is also included for making | |
* the serialization processes simpler. |
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 fs = require('fs'); | |
var bouncy = require('bouncy'); | |
// load up your instance and port into environment variables | |
var instance = (process.env.instance) ? process.instance.env : 'na1'; | |
var port = (process.env.port) ? process.env.port : 443; | |
// self-signed certificate created with openssl | |
var opts = { | |
key : fs.readFileSync(__dirname + '/key.pem'), |
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 vm = require('vm'); | |
var code = function run() { | |
for(var i=0; i<Infinity; i++) { | |
i++; | |
} | |
}; | |
var sandbox = { | |
setTimeout: setTimeout |
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
while(true) { | |
console.log('blah'); | |
} |
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
#!/bin/bash | |
QUERY="$(perl -MURI::Escape -e 'print uri_escape($ARGV[0]);' "$1")" | |
URL="https://www.google.com/search?q=$QUERY" | |
open $URL |
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 express = require('express'); | |
var request = require('request'); | |
var app = module.exports = express(); | |
app.configure(function() { | |
app.use(express.bodyParser()); | |
app.use(express.methodOverride()); | |
app.use(app.router); | |
}); |
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 express = require('express'); | |
var http = require('http'); | |
var path = require('path'); | |
var request = require('request'); | |
var $ = require('cheerio'); | |
var WSJ_PRIME_URL = 'http://www.bankrate.com/rates/interest-rates/wall-street-prime-rate.aspx'; | |
var app = express(); |
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 app = express(); | |
var server = require('http').createServer(app); | |
var io = require('./ioinit')(server); | |
server.listen(80); |
OlderNewer