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
| <?php | |
| /*** | |
| * Pull HTML source for given URL and format for output | |
| * 2011 haliphax https://github.com/haliphax | |
| **/ | |
| ?> | |
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <title>Format page as plain text</title> |
| /* | |
| ffmpeg -i "$file" -f s32be -acodec pcm_s32be -ar 44100 -af "volume=0.5" tcp://espip:5522 | |
| */ | |
| #include "i2s.h" | |
| #include <ESP8266WiFi.h> | |
| const char* ssid = "***********"; | |
| const char* password = "**********"; | |
| WiFiServer pcmServer(5522); | |
| static WiFiClient pcmClient; |
| // 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 |
| 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 |
| <!DOCTYPE html> | |
| <html> | |
| <head> | |
| <title>Demo</title> | |
| <style type="text/css"> | |
| body{ | |
| background-color:#ccc; | |
| padding: 20px; |
| 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 }; |
| (function() { | |
| function DateDiff(date1, date2) { | |
| this.days = null; | |
| this.hours = null; | |
| this.minutes = null; | |
| this.seconds = null; | |
| this.date1 = date1; | |
| this.date2 = date2; |
| //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); |
| // @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; | |
| }; |