Skip to content

Instantly share code, notes, and snippets.

View calderaro's full-sized avatar

Angel Calderaro calderaro

View GitHub Profile
@calderaro
calderaro / LRC.java
Created April 2, 2016 01:03
Longitudinal Redundancy Check (LRC) calculator for a byte array.
public class LRC {
public static byte calculateLRC(byte[] bytes) {
byte LRC = 0;
for (int i = 0; i < bytes.length; i++) {
LRC ^= bytes[i];
}
return LRC;
}
}
@calderaro
calderaro / index.html
Created March 3, 2016 20:54 — forked from anonymous/index.html
Services average // source http://jsbin.com/dekogepivu
<!DOCTYPE html>
<html>
<head>
<meta charset="ISO-8859-1">
<title>Services average</title>
</head>
<body>
<select id="service">
<option value="none">Select Service</option>
<option value="carpentry">Carpentry</option>
@calderaro
calderaro / static_server.js
Last active September 3, 2015 01:38 — forked from ryanflorence/static_server.js
Node.JS static file web server. Put it in your path to fire up servers in any directory, takes an optional port argument.
var http = require("http"),
url = require("url"),
path = require("path"),
fs = require("fs")
port = process.argv[2] || 8888;
http.createServer(function(request, response) {
var uri = url.parse(request.url).pathname
, filename = path.join(process.cwd(), uri);