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 / 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");
})
@JesterXL
JesterXL / gist:cf647b8559be70903750
Created July 23, 2014 16:47
No separate stream - works
List myList = new List();
StreamController controller = new StreamController();
controller.stream.listen((_)
{
print("data: $_");
});
controller.add("sup");
@JesterXL
JesterXL / Gruntfile.js
Last active August 29, 2015 14:04
Example Grunt jslint task
module.exports = function(grunt) {
// Project configuration.
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
jshint: {
all: ["Gruntfile.js"]
},
jscs: {
src: "*.js",
@JesterXL
JesterXL / Logger.js
Last active August 29, 2015 14:04
Logger class for Angular so you can turn it off. // TODO: add production mode for warnings and errors only
angular.module('logging', ['ngResource'])
.factory('Logger', function($log)
{
var Logger = {
enabled: true,
_consoleObject: $log,
_console: function(type, first, second)
{
@JesterXL
JesterXL / StacktraceService.js
Created August 4, 2014 19:18
StacktraceService
// Why? For production level stack traces for a variety of devices.
factory("StacktraceService",
function($window)
{
// [jwarden 2014] NOTE: She's a global method based on stacktrace.js, but if we change her,
// we can just change the method.
return({
printStackTrace: printStackTrace
});
}