Skip to content

Instantly share code, notes, and snippets.

Avatar
🏠
Working from home

Brandon Satrom bsatrom

🏠
Working from home
View GitHub Profile
View keybase.md

Keybase proof

I hereby claim:

  • I am bsatrom on github.
  • I am bsatrom (https://keybase.io/bsatrom) on keybase.
  • I have a public key ASDI02GdW9ZXkuQdvIzH5IdSLjo_PLMz8aarJ_mRPPPM0Qo

To claim this, I am signing this object:

@bsatrom
bsatrom / ledmirror.cpp
Last active Jul 13, 2018
Mirror the onboard RGB LED on Particle devices to an external RGB LED
View ledmirror.cpp
// Automatically mirror the onboard RGB LED (Photon, Electron) to an external RGB LED
// LEDMirror.cpp
// Class set-up
class LEDMirror {
public:
LEDMirror(pin_t r, pin_t g, pin_t b) : pin_r(r), pin_g(g), pin_b(b) {
pinMode(pin_r, OUTPUT);
pinMode(pin_g, OUTPUT);
pinMode(pin_b, OUTPUT);
View orphanDBs.js
const Dotenv = require('dotenv')
const Winston = require('winston')
const Mongo = require('mongodb').MongoClient
var XervoHost
Dotenv.config()
const createURI = (port, user, password) => {
if (!user || !password) {
return `mongodb://localhost:${port}`
@bsatrom
bsatrom / web.config
Created Mar 28, 2012 — forked from jglozano/web.config
Simple web.config
View web.config
<?xml version="1.0"?>
<configuration>
<appSettings>
<add key="webpages:Version" value="1.0.0.0"/>
<add key="ClientValidationEnabled" value="true"/>
<add key="UnobtrusiveJavaScriptEnabled" value="true"/>
</appSettings>
<system.webServer>
<validation validateIntegratedModeConfiguration="false"/>
@bsatrom
bsatrom / click.js
Created Mar 14, 2012
Example of script for Kendo UI DataViz Gauge
View click.js
$('#add').bind('click', function() {
var amt, intakeRecord, grid, gauge;
amt = parseInt($('#dailyIntake').val()) || 0;
intakeRecord = { date: getDate(), amount: amt }
intakeData.add(intakeRecord);
gauge = $("#srirachaGauge").data("kendoGauge");
gauge.value(avgIntake());
});
@bsatrom
bsatrom / CoffeeScript.md
Created Feb 16, 2012
Publication Cast-Offs
View CoffeeScript.md

Removed from Article on CoffeeScript for .net Magazine

So if you're looking to improve your craft as a JavaScript programmer, try CoffeeScript. And if you're of the firm opinion that CoffeeScript has no place for you because it doesn't generate JavaScript as well as you can, don't use it for your production code. But do use it. Try some things out, and inspect the result. It probably won't make you grow a neckbeard and switch to Python. Probably.

@bsatrom
bsatrom / hook_stdout.coffee
Created Nov 8, 2011
Samples for hooking into STDOUT for unit testing in Node.js
View hook_stdout.coffee
exports = module.exports
exports.setup = (callback) ->
write = process.stdout.write
process.stdout.write = ((stub) ->
(string, encoding, fd) ->
stub.apply process.stdout, arguments
callback string, encoding, fd)(process.stdout.write)
@bsatrom
bsatrom / createThubbarButtons.js
Created Nov 7, 2011
Pinify Update to support hidding thumbbar buttons by default
View createThubbarButtons.js
createThumbbarButtons: function (options) {
var defaultOptions;
if (!siteModeSupported()) {
return this;
}
defaultOptions = {
buttons: []
};
options = $.extend({}, defaultOptions, options);
return callWindowExternalSafely(function () {
@bsatrom
bsatrom / FluentHtml5ViewPage.cs
Created Sep 1, 2011
HTML5 Web Forms, ASP.NET MVC and MvcContrib
View FluentHtml5ViewPage.cs
public class FluentHtml5ViewPage<T> : ModelViewPage<T> where T : class
{
public FluentHtml5ViewPage()
: base(new RegularExpressionBehavior(), new RangeBehavior(), new RequiredBehavior()){}
}
@bsatrom
bsatrom / raw.html
Created Sep 1, 2011
HTML5 Web Forms, ASP.NET MVC and MvcContrib
View raw.html
<fieldset>
<legend>Place Your Order</legend>
Name: <input type="text" class="field" id="orderName" required autofocus placeholder="ex. Hugo Reyes" />
Email: <input type="email" class="field" id="orderEmail" required placeholder="ex. name@domain.com" />
Website: <input type="url" class="field" id="orderWebsite" placeholder="ex. http://www.domain.com" />
Phone: <input type="tel" id="orderTelephone" class="field" pattern="\(\d\d\d\) \d\d\d\-\d\d\d\d" title="(xxx) xxx-xxxx" />
Requested Delivery Date: <input type="date" id="deliveryDate" class="field" required />
Shipping Address: <textarea rows="4" cols="20" id="orderShipping" class="field" required></textarea>
Quantity: <input type="number" id="orderQty" name="orderQty" min=1 max=10 step=1 value=1 />
<input type="submit" value="Place Order" />