Skip to content

Instantly share code, notes, and snippets.

View joachimhs's full-sized avatar

Joachim Haagen Skeie joachimhs

View GitHub Profile
POST /upload HTTP/1.1
Host: localhost:8991
Connection: keep-alive
Content-Length: 4914
Accept: application/json, text/plain, */*
Origin: https://create.arduino.cc
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/52.0.2743.116 Safari/537.36
Content-Type: application/json;charset=UTF-8
Referer: https://create.arduino.cc/editor/joachimhs/92bdba23-c0da-4097-b133-94a3d72eb87a
Accept-Encoding: gzip, deflate, br
{
"data": {
"id": "reference number",
"type": "smsMessage",
"attributes": {
"sentStatus": "true",
"errorCode": 0
},
"relationships": {
"smsReceipts": {
@joachimhs
joachimhs / PixelHunt
Last active August 29, 2015 14:17
PixelHunt
#include <Adafruit_NeoPixel.h>
int ledPin = 9;
int lamper = 64;
int spillerEnPosisjon = 0;
int spillerEnPoeng = 0;
int spillerEnX = 0;
int spillerEnY = 1;
window.pretender = new Pretender(function(){
// no routes
});
window.pretender.unhandledRequest = function(verb, path, request) {
console.log("window.pretender.unhandledReques");
console.log(verb);
console.log(path);
console.log(request);
};
Ember.Test.registerHelper("mockAjaxGet", function(app, url, responseStatus, responseJson) {
console.log("STUBBING: " + url + " responseStatus: " + responseStatus + " JSON: " + responseJson);
window.server.get(url, function(request) {
return [responseStatus, {"Content-Type": "application/json"}, responseJson];
});
});
JSON Payload:
{
"raspberryPis": [
{
"id": "piHome",
"name": "piHome",
"category": "raspberryPis",
"content": null,
"projects": [
/* global require, module */
var EmberApp = require('ember-cli/lib/broccoli/ember-app');
var app = new EmberApp();
// Use `app.import` to add additional libraries to the generated
// output files.
//
// If you need to use different assets in different
public class UploadEmberfestPhotoHandler extends ContenticeHandler {
private static final Logger logger = Logger.getLogger(UploadEmberfestPhotoHandler.class.getName());
@Override
protected void channelRead0(ChannelHandlerContext channelHandlerContext, FullHttpRequest fullHttpRequest) throws Exception {
String jsonReturn = "{}";
String messageContent = getHttpMessageContent(fullHttpRequest);
String contentType = getContentType(fullHttpRequest);
App.Router.map(function() {
this.resource('index', {path: '/'}, function() {
this.resource('people', { path: '/people' }, function() {
this.route('active');
this.route('completed');
});
this.resource('places', {path: '/places'}, function() {});
this.resource('things', {path: '/things'}, function() {});
});
});
@joachimhs
joachimhs / gist:8466570
Created January 17, 2014 00:59
Precompiled Ember templates
Ember.TEMPLATES["application"] = Ember.Handlebars.template(function anonymous(Handlebars,depth0,helpers,partials,data) {
this.compilerInfo = [4,'>= 1.0.0'];
helpers = this.merge(helpers, Ember.Handlebars.helpers); data = data || {};
var buffer = '', stack1, helper, options, helperMissing=helpers.helperMissing, escapeExpression=this.escapeExpression;
data.buffer.push(escapeExpression((helper = helpers.render || (depth0 && depth0.render),options={hash:{},hashTypes:{},hashContexts:{},contexts:[depth0],types:["ID"],data:data},helper ? helper.call(depth0, "header", options) : helperMissing.call(depth0, "render", "header", options))));
data.buffer.push("\n<div id=\"mainArea\">\n ");
stack1 = helpers._triageMustache.call(depth0, "outlet", {hash:{},hashTypes:{},hashContexts:{},contexts:[depth0],types:["ID"],data:data});
if(stack1 || stack1 === 0) { data.buffer.push(stack1); }