Finally, the GSoC coding period is coming to an end as I finish up my project. In this post I aim to summarize all of the work I have done during the past months.
- Student : Sagarpreet Chadha
- Github : sagarpreet-chadha
- Organisation : PublicLab
module Paperclip | |
#converts a string into a file for paperclip to save | |
# useage | |
# self.avatar = Paperclip::string_to_file('bob.png', 'image/png', 'BASE64 here') | |
def self.string_to_file(name, type, data) | |
image = StringIO.new(data) | |
image.class.class_eval { attr_accessor :original_filename, :content_type } | |
image.original_filename = name | |
image.content_type = type |
<!doctype html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<title>WebRTC p2p data</title> | |
<script src="https://webrtc-samples.googlecode.com/svn/trunk/apprtc/js/adapter.js"></script> | |
</head> | |
<body> | |
Testing WebRTC connection. |
## within current branch, squashes all commits that are ahead of master down into one | |
## useful if you merged with upstream in the middle of your commits (rebase could get very ugly if this is the case) | |
## commit any working changes on branch "mybranchname", then... | |
git checkout master | |
git checkout -b mybranchname_temp | |
git merge --squash mybranchname | |
git commit -am "Message describing all squashed commits" | |
git branch -m mybranchname mybranchname_unsquashed | |
git branch -m mybranchname |
attempt_autocalibrate = function(min_required_intensity) { | |
//The following two are copied from end; before calling attempt_autocalib | |
flotoptions.grid.markings = [] | |
$W.plot = $.plot($("#graph"),$W.data,flotoptions); | |
var max_limit = 5 | |
//min_required_intensity = 20 | |
var max_green = -1000 // We need to find the maximum value of G first |
{ | |
"uuid": "f27b5235-e517-4fc9-8467-1270bbac7bbf", | |
"description": "Warping with WebGL", | |
"dependencies": {}, | |
"operatorOverloading": false | |
} |
# Warning: The contents of the database defined as "test" will be erased and | |
# re-generated from your development database when you run "rake". | |
# Do not set this db to the same as development or production. | |
test: | |
adapter: mysql2 | |
username: <username> | |
password: | |
database: publiclab_test | |
encoding: utf8 | |
pool: 5 |
// set basic attributes here; | |
// "this" means this ant you're editing now | |
this.speed = 1; | |
this.color = 'red'; | |
this.height = 40; | |
this.width = 40; | |
// runs every frame: | |
onRun = function () { |
// hard won knowledge from http://stackoverflow.com/questions/20035615/using-raw-image-data-from-ajax-request-for-data-uri | |
var xmlHTTP = xhr.XMLHttpRequest(); | |
xmlHTTP.open('GET', url, true); | |
xmlHTTP.responseType = 'arraybuffer'; | |
xmlHTTP.onload = function(e) { | |
var arr = new Uint8Array(this.response); | |
var raw = String.fromCharCode.apply(null,arr); | |
var b64 = base64.encode(raw); | |
var dataURL="data:image/png;base64," + b64; | |
}; |
var express = require('express'); | |
var request = require('request'); | |
var app = express(); | |
app.use(function(req, res, next) { | |
res.header("Access-Control-Allow-Origin", "*"); | |
res.header("Access-Control-Allow-Headers", "Origin, X-Requested-With, Content-Type, Accept"); | |
next(); | |
}); |
Finally, the GSoC coding period is coming to an end as I finish up my project. In this post I aim to summarize all of the work I have done during the past months.