This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* object.watch polyfill | |
* | |
* 2012-04-03 | |
* | |
* By Eli Grey, http://eligrey.com | |
* Public Domain. | |
* NO WARRANTY EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK. | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- | |
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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* 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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<canvas id="canvas" width="512" height="256" ></canvas> | |
<p id="controls"> | |
<input type="button" id="start_button" value="Start"> | |
| |
<input type="button" id="stop_button" value="Stop"> | |
</p> | |
<!-- ----------------------------------------------------- --> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<canvas id="canvas" width="512" height="256" ></canvas> | |
<p id="controls"> | |
<input type="button" id="start_button" value="Start"> | |
| |
<input type="button" id="stop_button" value="Stop"> | |
</p> | |
<!-- ----------------------------------------------------- --> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<canvas id="canvas" width="800" height="256" ></canvas> | |
<p id="controls"> | |
<input type="button" id="start_button" value="Start"> | |
| |
<input type="button" id="stop_button" value="Stop"> | |
</p> | |
<!-- ----------------------------------------------------- --> |
OlderNewer