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 void onStart(Intent intent, int startId) { | |
super.onStart(intent, startId); | |
timer = Executors.newScheduledThreadPool(2); | |
timer.scheduleAtFixedRate(new Runnable() { | |
public void run() { | |
} | |
}, 0, 300, TimeUnit.SECONDS); | |
} |
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
grammar Gdl; | |
options{ | |
output=AST; | |
} | |
start : fieldlist; | |
fieldlist : field (COMMA field)* -> field*; | |
field : STRING L fieldlist R -> ^(STRING fieldlist) | |
| STRING ; |
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
TestNode node = new TestNode("what","the","foo",new TestNode[]{ | |
new TestNode("are", "you", "there",new TestNode[]{ | |
new TestNode("are", "you", "there"),new TestNode | |
("yes", "i","am") | |
}) | |
,new TestNode("yes", "i", "am")},new TestNode[]{ | |
new TestNode("crap","this","works") | |
} | |
); |
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
{ | |
name:what, | |
id:the, | |
othernodes:{ | |
name:crap | |
}, | |
nodes:{ | |
other:there, | |
nodes:{ | |
id:you, |
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
//server.js | |
var http = require('http'); //http lib used to build the 'client' | |
var express = require('express'); //express helps us build the 'server' a bit faster | |
var app = express.createServer(); //used for serving up the main template and the js model | |
//app.get('/models/data.js', function(req, res){ res.sendfile(__dirname + '/models/data.js') }) //serve up the model when requested specifically | |
app.use(express.staticProvider(__dirname + '/models')); //using static provide middleware to serve whole model directory | |
app.get('/panic', function(req, res){ //perform all this logic when /panic is requested |
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
dojo.declare("custom.EnhancedJsonRestStore", dojox.data.JsonRestStore, { | |
"-chains-": { | |
constructor: "manual" | |
}, | |
constructor : function(options) { | |
dojo.safeMixin(this,options); | |
this.service = dojox.rpc.JsonRest.services[options.target] || dojox.rpc.Rest(options.target, true, null, options.getRequest); |
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 target = defaultObject || it; | |
//================================================================================================================================================= | |
// BEGIN - Customizations to produce real RESTful URIs instead from representation hierarchy instead of the shameless excuse for URIs dojo is producing | |
//================================================================================================================================================= | |
var targUrl = prefix.substring(0, prefix.length - 1);; | |
var stack = new Array(); | |
var crawler = target; | |
if( crawler.__parent && crawler.__parent.id ){ |
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
String signed_request = "-BcQzSUqk_dIsNtuurd4kawKsrO2J_WqyL7vDteT3yU.eyJhbGdvcml0aG0iOiJITUFDLVNIQTI1NiIsImV4cGlyZXMiOjEzMTI5OTkyMDAsImlzc3VlZF9hdCI6MTMxMjk5NDY0OCwib2F1dGhfdG9rZW4iOiIxODM4OTk2NzUwMTEzMDN8Mi5BUUNKX2Y3NlJWamlRQ2FDLjM2MDAuMTMxMjk5OTIwMC4xLTUxMzA1MDY4NnxfYXduR2NoaUdsMkkyNXFOQlpHREpYNnhrdmciLCJ1c2VyIjp7ImNvdW50cnkiOiJ1cyIsImxvY2FsZSI6ImVuX1VTIiwiYWdlIjp7Im1pbiI6MjF9fSwidXNlcl9pZCI6IjUxMzA1MDY4NiJ9"; | |
String rawpayload = signed_request.split("\\.")[1]; | |
String signature = signed_request.split("\\.")[0].replace("-", "+").replace("_", "/").trim(); | |
String facebookSecret = "3035c2fd47ddbff344d55fb878d2cfa7"; | |
BASE64Decoder decoder = new BASE64Decoder(); | |
//Ouput payload | |
System.out.println(new String(decoder.decodeBuffer(rawpayload.replace("-", "+").replace("_", "/").trim()))); |
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 emitter = require('events').EventEmitter; | |
var util = require('util'); | |
var dog = function(){}; | |
//dog.prototype = { | |
// name: "i am a dog", | |
//}; | |
// 1st way of inheriting | |
//dog.prototype.__proto__ = new emitter(); |
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
#/etc/consul.d/config.json | |
{ | |
"server" : true, | |
"node_name" : "ep-server", | |
"bootstrap_expect" : 1, | |
"data_dir" : "/tmp/consul", | |
"ports" : { | |
"dns" : 53 | |
} | |
} |
OlderNewer