Skip to content

Instantly share code, notes, and snippets.

@Rcomian
Rcomian / gist:3705356
Created September 12, 2012 08:53
JSLint for wsh - works from msbuild
// jslint.js
// 2012-03-29
// Copyright (c) 2002 Douglas Crockford (www.JSLint.com)
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
@Rcomian
Rcomian / whiteboard.js
Created October 30, 2012 13:37
Basic whiteboard class for demonstrations
function WhiteBoard(canvas, onLine) {
// Drawing
var ctx = canvas[0].getContext('2d');
var self = this;
this.randomColor = function () {
var col = [
Math.floor(Math.random() * 256),
Math.floor(Math.random() * 256),
Math.floor(Math.random() * 256)
@Rcomian
Rcomian / Demo infrastructure
Created October 30, 2012 14:01
Basic socket.io infrastructure
// Server
var socketio = require('socket.io');
var server = http.createServer(app);
var io = socketio.listen(server);
io.sockets.on('connection', function(socket) {
...
});
@Rcomian
Rcomian / REPL.js
Created October 30, 2012 14:20
Basic REPL framework
var net = require('net');
var repl = require('repl');
net.createServer(function (socket) {
var r = repl.start({
prompt: "node via TCP socket> ",
input: socket,
output: socket,
});
@Rcomian
Rcomian / stir
Created December 9, 2012 12:26
Randomize an Array
var crypto = require('crypto');
var hash = 'SHA512';
function getStirHash(key, blocknum, length) {
var stirhasher = crypto.createHash(hash);
stirhasher.update(key);
stirhasher.update(blocknum.toString().toString('binary'));
stirhasher.update(length.toString().toString('binary'));
return new Buffer(stirhasher.digest('binary'), 'binary');
@Rcomian
Rcomian / gist:5295374
Created April 2, 2013 19:23
Xml in C#
// http://msdn.microsoft.com/en-us/library/azsy1tw2.aspx
using System;
using System.IO;
using System.Xml;
public class Sample
{
public static void Main()
{
class MyClass : IDisposable
{
private bool disposed = false;
protected virtual void Dispose(bool disposing)
{
if (!disposed)
{
if (disposing)
{
// Dispose managed resources

Keybase proof

I hereby claim:

  • I am rcomian on github.
  • I am rcomian (https://keybase.io/rcomian) on keybase.
  • I have a public key ASAFJiu84_uq3ZK_yFtBrq7e6s8IKwtcnx-W_3fbTy_Eewo

To claim this, I am signing this object:

%~d0
cd %~d0%~p0
call npm init
call npm install --save node-red
call npm install --save @autocodingsystems/node-red-utils
call npm install --save node-red-contrib-mqtt-broker
call npm install --save node-red-dashboard
call npm install --save winser
https://www.amazon.co.uk/Tour-C-Depth/dp/0134997832
https://github.com/isocpp/CppCoreGuidelines/blob/master/CppCoreGuidelines.md