Skip to content

Instantly share code, notes, and snippets.

<?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>
<canvas id="canvas" width="800" height="256" ></canvas>
<p id="controls">
<input type="button" id="start_button" value="Start">
&nbsp; &nbsp;
<input type="button" id="stop_button" value="Stop">
</p>
<!-- ----------------------------------------------------- -->
<canvas id="canvas" width="512" height="256" ></canvas>
<p id="controls">
<input type="button" id="start_button" value="Start">
&nbsp; &nbsp;
<input type="button" id="stop_button" value="Stop">
</p>
<!-- ----------------------------------------------------- -->
@mwiemarc
mwiemarc / tutorial_30_example_1.html
Created May 19, 2017 00:50 — forked from webapprentice/tutorial_30_example_1.html
Simple example of Web Audio analysis and visualization
<canvas id="canvas" width="512" height="256" ></canvas>
<p id="controls">
<input type="button" id="start_button" value="Start">
&nbsp; &nbsp;
<input type="button" id="stop_button" value="Stop">
</p>
<!-- ----------------------------------------------------- -->
@mwiemarc
mwiemarc / bitcolor.js
Created May 14, 2017 18:31 — forked from lrvick/bitcolor.js
Javascript functions for doing fast binary/hex/RGB color conversions using bitwise operations.
// convert 0..255 R,G,B values to binary string
RGBToBin = function(r,g,b){
var bin = r << 16 | g << 8 | b;
return (function(h){
return new Array(25-h.length).join("0")+h
})(bin.toString(2))
}
// convert 0..255 R,G,B values to a hexidecimal color string
RGBToHex = function(r,g,b){
@mwiemarc
mwiemarc / color-conversion-algorithms.js
Created May 14, 2017 01:49 — forked from mjackson/color-conversion-algorithms.js
RGB, HSV, and HSL color conversion algorithms in JavaScript
/**
* Converts an RGB color value to HSL. Conversion formula
* adapted from http://en.wikipedia.org/wiki/HSL_color_space.
* Assumes r, g, and b are contained in the set [0, 255] and
* returns h, s, and l in the set [0, 1].
*
* @param Number r The red color value
* @param Number g The green color value
* @param Number b The blue color value
* @return Array The HSL representation
@mwiemarc
mwiemarc / HexRGB.ino
Created May 13, 2017 11:23 — forked from hsiboy/HexRGB.ino
FastLED - read value from given pixel and convert to hex RGB
long HexRGB = ((long)leds[i].r << 16) | ((long)leds[i].g << 8 ) | (long)leds[i].b; // get value and convert.
Serial.println("Hex: 0x" + String(HexRGB, HEX));
@mwiemarc
mwiemarc / stickynotes_install.sh
Created April 21, 2017 21:21 — forked from trdlo/stickynotes_install.sh
sticky_notes install @ nginx
# http://sayakb.github.io/sticky-notes/pages/install/
# https://github.com/sayakb/sticky-notes
mkdir /var/www/paste && cd /var/www/paste.domain.tld && git clone https://github.com/sayakb/sticky-notes.git .
chown -Rv www-data:www-data /var/www/paste
cp stickynotes_nginx.conf /etc/nginx/sites-enabled/paste.domain.tld
ln -s /etc/nginx/sites-available/paste.domain.tld /etc/nginx/sites-enabled/.
/etc/init.d/nginx reload
cd /var/www/paste.domain.tld/app/config
mv database.sample.php database.php
@mwiemarc
mwiemarc / index.html
Created December 1, 2016 14:04
Simples MVVM Example with Javascript
<!--
English:
This example show how do a simple MVVM code with html+js
You can change the data in design and the object person will be changed, you can too make the change by the console(js) of the property from the object and the visual will be changed.
Portugues:
Esse exemplo mostra como fazer um simples MVVM framework com HTML e JS
Você pode alterar os dados visualmente e o objeto pessoa vai ser alterado e também se você fizer a alteração via console da propriedade o visual será modificado.
-->
<!DOCTYPE html>
<html>
@mwiemarc
mwiemarc / object-watch.js
Created November 17, 2016 18:21 — forked from eligrey/object-watch.js
object.watch polyfill in ES5
/*
* object.watch polyfill
*
* 2012-04-03
*
* By Eli Grey, http://eligrey.com
* Public Domain.
* NO WARRANTY EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK.
*/