The only cross-platform browser that fits in a Gist!
One line install. Works on Linux, MacOSX and Windows.
$> npm install http://gist.github.com/morganrallen/f07f59802884bcdcad4a/download
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
# | |
# Copyright (C) 2008-2013 Edgewall Software | |
# Copyright (C) 2008 Eli Carter | |
# All rights reserved. | |
# | |
# This software is licensed as described in the file COPYING, which | |
# you should have received as part of this distribution. The terms | |
# are also available at http://trac.edgewall.com/license.html. |
// @source: http://stackoverflow.com/questions/1349404/generate-a-string-of-5-random-characters-in-javascript | |
function randomStr(m) { | |
var m = m || 9; s = '', r = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789'; | |
for (var i=0; i < m; i++) { s += r.charAt(Math.floor(Math.random()*r.length)); } | |
return s; | |
}; |
//http://stackoverflow.com/questions/105034/how-to-create-a-guid-uuid-in-javascript | |
Math.random().toString(36).substring(2, 15) + Math.random().toString(36).substring(2, 15); |
(function() { | |
function DateDiff(date1, date2) { | |
this.days = null; | |
this.hours = null; | |
this.minutes = null; | |
this.seconds = null; | |
this.date1 = date1; | |
this.date2 = date2; |
function convertMS(ms) { | |
var d, h, m, s; | |
s = Math.floor(ms / 1000); | |
m = Math.floor(s / 60); | |
s = s % 60; | |
h = Math.floor(m / 60); | |
m = m % 60; | |
d = Math.floor(h / 24); | |
h = h % 24; | |
return { d: d, h: h, m: m, s: s }; |
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Demo</title> | |
<style type="text/css"> | |
body{ | |
background-color:#ccc; | |
padding: 20px; |
using System; | |
using System.Collections.Generic; | |
using System.Net.Sockets; | |
using System.Net; | |
using System.IO; | |
using System.Threading; | |
using System.Windows.Forms; | |
using Westwind.Utilities; | |
namespace Westwind.WebConnection |
.row { | |
display: flex; | |
flex-wrap: wrap; | |
margin-left: 0; | |
margin-right: 0; | |
} | |
.row.row-gapless { | |
margin-left: 0; | |
margin-right: 0; |
// Slightly modified Adalight protocol implementation that uses FastLED | |
// library (http://fastled.io) for driving WS2811/WS2812 led stripe | |
// Was tested only with Prismatik software from Lightpack project | |
#include "FastLED.h" | |
#define NUM_LEDS 114 // Max LED count | |
#define LED_PIN 6 // arduino output pin | |
#define GROUND_PIN 10 | |
#define BRIGHTNESS 255 // maximum brightness |