Skip to content

Instantly share code, notes, and snippets.

View JesterXL's full-sized avatar
🔊
writing

Jesse Warden JesterXL

🔊
writing
View GitHub Profile
@JesterXL
JesterXL / AbstractService.as
Created September 27, 2013 14:17
Abstract Service uses ResponseFactory
/*
* Copyright (c) 2010 Home Box Office, Inc. as an unpublished
* work. Neither this material nor any portion hereof may be copied
* or distributed without the express written consent of Home Box Office, Inc.
*
* This material also contains proprietary and confidential information
* of Home Box Office, Inc. and its suppliers, and may not be used by or
* disclosed to any person, in whole or in part, without the prior written
* consent of Home Box Office, Inc.
*/
@JesterXL
JesterXL / main.lua
Created September 30, 2013 17:21
Updating score
score = 0;
function getScore()
return score
end
function setScore(value)
score = value
Runtime:dispatchEvent({name="onScoreChanged"})
end
@JesterXL
JesterXL / test.js
Created October 4, 2013 17:36
Simple inner function call.
var test = {
foo: function()
{
console.debug("I'm foo.");
},
bar: function()
{
console.debug("I'm bar.");
console.debug("calling foo: ", test.foo());
}
@JesterXL
JesterXL / dart-login-django.dart
Created March 4, 2014 03:08
Sample Dart code to login to Django
void getToken()
{
print("getToken");
getTokenService = new GetTokenService();
getTokenService.getToken().then((ServiceEvent event)
{
login();
});
}
@JesterXL
JesterXL / main.lua
Created May 30, 2014 19:00
Stop Start of Process
function stop()
if circlespawner ~= nil then
timer.cancel(spawnCircle)
circlespawner = nil
end
end
function start()
stop()
circlespawner = timer.performWithDelay(1000, spawnCircle,0)
Remote Address:127.0.0.1:8000
Request URL:http://localhost:8000/workoutapi/get_token
Request Method:GET
Status Code:200 OK
Request Headersview source
Accept:*/*
Accept-Encoding:gzip,deflate,sdch
Accept-Language:en-US,en;q=0.8,es;q=0.6
Cache-Control:no-cache
Connection:keep-alive
Remote Address:127.0.0.1:8000
Request URL:http://localhost:8000/workoutapi/login_user
Request Method:OPTIONS
Status Code:200 OK
Request Headersview source
Accept:*/*
Accept-Encoding:gzip,deflate,sdch
Accept-Language:en-US,en;q=0.8,es;q=0.6
Access-Control-Request-Headers:x-csrftoken, content-type
Access-Control-Request-Method:POST
Remote Address:127.0.0.1:8000
Request URL:http://localhost:8000/workoutapi/login_user
Request Method:POST
Status Code:403 FORBIDDEN
Request Headersview source
Accept:*/*
Accept-Encoding:gzip,deflate,sdch
Accept-Language:en-US,en;q=0.8,es;q=0.6
Cache-Control:no-cache
Connection:keep-alive
@JesterXL
JesterXL / Single Stream
Last active August 29, 2015 14:04
Single Stream - doesn't work
List myList = new List();
Stream myStream = new Stream.fromIterable(myList);
StreamController controller = new StreamController();
controller.stream.listen((_)
{
print("stream listen, data: $_");
});
controller.addStream(myStream)
.then((_)
@JesterXL
JesterXL / gist:b3dd5dc4978f33535b46
Created July 23, 2014 16:44
Broadcast Stream - works
List myList = new List();
Stream myStream = new Stream.fromIterable(myList);
StreamController controller = new StreamController.broadcast();
controller.addStream(myStream)
.then((_)
{
print("ready");
myList.add("sup");
})