Skip to content

Instantly share code, notes, and snippets.

View krisdahl's full-sized avatar

Kris Dahl krisdahl

View GitHub Profile
@krisdahl
krisdahl / handlebars.object_helpers.js
Created October 16, 2012 21:30 — forked from strathmeyer/handlebars.object_helpers.js
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, options) {
var buffer = "",
key;
<string>(?:^\s+)?(&lt;)((?i:script))\b(?![^&gt;]*/&gt;)</string>
=>
<string>(?:^\s+)?(&lt;)((?i:script))\b(?!([^&gt;]*text/template[^&gt;]*|[^&gt;]*/>))</string>
@carolineschnapp
carolineschnapp / gist:5397337
Last active January 20, 2023 10:11
Sample JavaScript file added with ScriptTag resource. This sample file is meant to teach best practices. Your app will load jQuery if it's not defined. Your app will load jQuery if jQuery is defined but is too old, e.g. < 1.7.
/* Sample JavaScript file added with ScriptTag resource.
This sample file is meant to teach best practices.
Your app will load jQuery if it's not defined.
Your app will load jQuery if jQuery is defined but is too old, e.g. < 1.7.
Your app does not change the definition of $ or jQuery outside the app.
Example: if a Shopify theme uses jQuery 1.4.2, both of these statements run in the console will still return '1.4.2'
once the app is installed, even if the app uses jQuery 1.9.1:
jQuery.fn.jquery => "1.4.2"
$.fn.jquery -> "1.4.2"
*/
@imorrish
imorrish / BMDSDITallySend.ino
Created July 8, 2019 23:11
Blackmagic Design Camera Tally using SDI Shield and Arduino GPIO
/*
SDI Tally interface based
Turns tally of the cameras on and off based on pins pulled low.
This interface is programed for Potential free outputs on a video mixer.
This means that if the tally output of the video mixer is active it will make a connection to ground.
By configuring the inputs with pull-up they are active 5V high and when pulled low to GND it will send that ports tally to the SDI output.
Written by Daniel Wittenaar for free use.
Use code and arduino's with care!! I'm not responsable for any damage caused by using this code!!
@daz
daz / gulpfile.js
Last active February 7, 2022 22:52
Gulpfile to minify single HTML, CSS, JS file, make it a C++ string, and inject it into a C++ file. Handy for Arduino/ESP projects
const gulp = require("gulp");
const gutil = require("gulp-util");
const inject = require("gulp-inject");
const htmlMin = require("gulp-htmlmin");
const cssMinifyOptions = true;
const jsMinifyOptions = {
mangle: {
toplevel: true
},