Skip to content

Instantly share code, notes, and snippets.

@brettcvz
brettcvz / lti_config.json
Created March 5, 2024 18:29
Canvas LTI<>Metabase glue layer
{
"title":"SPS Canvas -> Metabase Link",
"scopes":[],
"extensions":[
{
"domain":"spstools.summitps.org",
"tool_id":"sps-canvas-metabase",
"platform":"canvas.instructure.com",
"settings":{
"text":"SPS Analytics",
@brettcvz
brettcvz / index.html
Created July 3, 2017 20:24
Probability grapher/calculator for DnD 5e dice rolls
<!DOCTYPE html>
<html>
<head>
<script
src="https://code.jquery.com/jquery-3.2.1.min.js"
integrity="sha256-hwg4gsxgFZhOsEEamdOYGBf13FyQuiTwlAQgxVSNgt4="
crossorigin="anonymous">
</script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/flot/0.8.3/jquery.flot.min.js"></script>
<style>
@brettcvz
brettcvz / messenger.js
Created March 20, 2015 02:40
JS-Applescript to send iMessages
#!/usr/bin/env osascript -l JavaScript
function run(argv) {
var to = argv[0];
var msg = argv[1];
console.log("Sending message", "'" + msg + "'", "to", to);
messages = Application('Messages');
var service;
for (var i in messages.services) {
@brettcvz
brettcvz / gist:9279647
Created February 28, 2014 20:51
Keybase proof
### Keybase proof
I hereby claim:
* I am brettcvz on github.
* I am brettcvz (https://keybase.io/brettcvz) on keybase.
* I have a public key whose fingerprint is D7C1 CB53 CFA5 D6C8 3856 ECA8 0784 1CD7 F723 9F7C
To claim this, I am signing this object:
@brettcvz
brettcvz / Server.sh
Last active December 31, 2015 23:49
Audio streaming teleportation
pacat -r -d alsa_output.pci-0000_00_1b.0.analog-stereo.monitor | ncat -k --send-only -l -p 1337 > server_output.txt &
ssh -R 1339:localhost:1337 hopscotch.inkmobility.com &
@brettcvz
brettcvz / gm-composite.js
Created September 26, 2013 21:31
Node gm composition
//To use this, in another file call
//require("./gm-composite.js")(gm.prototype);
//You can then do gm("baseImage.png").composite(gm("watermark.png"), "SouthEast", function(err, composite_gm_obj){...});
var gm = require('gm');
var randInt = function(min, max) {
return Math.floor(min + (Math.random() * (max-min)));
};
@brettcvz
brettcvz / gist:6197978
Created August 9, 2013 22:53
Ink filepicker + Jcrop example
$(function(){
var jcrop_api;
var changeCrop = function(c){
//alert(c.w);
var url = $('#convert_url_link').attr('href');
var cropparams = [Math.floor(c.x),Math.floor(c.y),Math.floor(c.w),Math.floor(c.h)].join();
newurl = url.replace(/crop=[0-9]+,[0-9]+,[0-9]+,[0-9]+/, 'crop='+cropparams);
$('#convert_url_link').attr('href', newurl );
$('#process-image-thumb').attr('src', newurl );
@brettcvz
brettcvz / fpio_zencoder.html
Created March 21, 2013 16:00
Full js for integrating filepicker.io and zencoder
<!-- Replace the previous script tag with this one -->
<script type="text/javascript">
$(function() {
//Put your Filepicker.io API key here:
filepicker.setKey('A9gfeq0CMTMeP1dR86vcxz');
//Zencoder API key
var zenKey = 'ce887203717c4417267eeb7b59b55885';
$('a').click(function(e) {
e.preventDefault(); // This keeps the normal link behavior from happening
//Specifying all the extensions that zencoder can handle, you may want to choose a subset
@brettcvz
brettcvz / fpio_starter.html
Created March 21, 2013 15:59
Starter script for using Filepicker.io
<!-- Add this just before the </head> tag -->
<script type="text/javascript">
$(function() {
//Put your Filepicker.io API key here:
filepicker.setKey('A9gfeq0CMTMeP1dR86vcxz');
$('a').click(function(e) {
e.preventDefault(); // This keeps the normal link
// behavior from happening
filepicker.pickAndStore({},{location: 's3'},
function(fpfiles){
@brettcvz
brettcvz / base template.html
Last active December 15, 2015 06:09
Base HTML template for Filepicker.io and Zencoder integration
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US"
lang="en-US">
<head>
<meta http-equiv="content-type" content="text/html;
charset=utf-8" />
<title>Zencoder Dropzone</title>
<!-- jQuery Include -->
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<!-- Filepicker.io Include -->