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
#include <linux/module.h> | |
#include <linux/kernel.h> | |
#include <linux/hrtimer.h> | |
#include <linux/ktime.h> | |
unsigned long timer_interval_ns = 1e6; | |
static struct hrtimer hr_timer; | |
enum hrtimer_restart timer_callback( struct hrtimer *timer_for_restart ) | |
{ |
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
function SettingsCtrl($scope, $http){ | |
$http.get("settings.json") | |
.success(function(data,status){ | |
$scope.settings = data; | |
}); | |
$scope.submit = function(){ | |
console.log($scope.settings); | |
$http.post("settings/", $scope.settings). | |
success(function(data,status){}) |
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 app = angular.module('gronicom', []); | |
app.factory('socket', function ($rootScope) { | |
var socket = io.connect(); | |
return { | |
on: function (eventName, callback) { | |
socket.on(eventName, function () { | |
var args = arguments; | |
$rootScope.$apply(function () { | |
callback.apply(socket, args); |
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 express = require("express"); | |
var app = express(); | |
var server = require('http').createServer(app); | |
var io = require('socket.io').listen(server); | |
var fs = require('fs'); | |
var printer = require("./printer.js"); | |
app.listen(3000); | |
var clientSocket; |
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
app.use (function(req, res, next) { | |
var data=''; | |
req.setEncoding('utf8'); | |
req.on('data', function(chunk) { | |
data += chunk; | |
}); | |
req.on('end', function() { |
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 express = require('express') | |
, mongoskin = require('mongoskin') | |
var app = express() | |
app.use(express.bodyParser()) | |
var db = mongoskin.db('localhost:27017/skintest', {safe:true}); | |
app.param('collectionName', function(req, res, next, collectionName){ | |
req.collection = db.collection(collectionName) |
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
origLog = console.log; | |
console.log = function(arg){ | |
if(typeof arg == "undefined") | |
console.trace(undefined); | |
} |
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
app.use(function(req,res,next){setTimeout(next,1000)}); // Simulating latenceny |
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
#! /bin/bash | |
wait=true | |
while $wait | |
do | |
sleep 1 | |
ready=$(curl -sL -w "%{http_code}\\n" $1 -o /dev/null) | |
if [ $ready -eq 200 ] | |
then | |
wait=false | |
fi |
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 express = require('express'); | |
var app = express(); | |
var dynAddress = null; | |
var dynPort = ""; | |
app.get("/reg", function(req,res){ | |
if(req.query.port) | |
dynPort = req.query.port; |
OlderNewer