Skip to content

Instantly share code, notes, and snippets.

@kerbeh
kerbeh / mixamoToBlenderBoneNames.py
Created December 5, 2019 01:00 — forked from naelstrof/mixamoToBlenderBoneNames.py
Convert Mixamo rig bone names (as imported to Blender via FBX) to standard Blender bone names. This is especially use if your mesh uses the 'mirror' modifier. 1 - Backup your Blend. 2 - In action editor disconnect any animation connected to the rig. 3 - Paste the script in a text window and select "run script". 4 - Notice that all bone names are…
# IMPORTANT: make sure no animation is assigned
# to the rig before you run this script,
# otherwise linked animation data will be corrupted.
import bpy
# ----------------------------------
# Mixamo left/right bone names start with 'Left'/'Right'
# Instead we apply Blender's standard .L/.R suffix
# and get rid of long suffix
@kerbeh
kerbeh / Using PHP GuzzleHttp Request Pools
Created July 8, 2019 08:01
Simple useage of GuzzleHttps request pools for concurrently running HTTP requests and returning responses for processing.
//One liner to batch an array of request objects
var_dump(Pool::batch($this->client, [$dropboxRequest, $quizRequest]));
die;
// Apply a function on fulfilled/rejected promises
// Mind the scope of the anonymous functions
$responses = [];
$errors = [];
@kerbeh
kerbeh / echomigrate.sh
Last active February 25, 2019 22:17
Quick Bash script to rebuild videos from the Echo 360 ESS flash format into mp4, highly dependant on framerate so check framerate if video is out of sync
#!/bin/bash
# Process an echo export into MP4 files
# requires FFMPEG -loglevel error -hide_banner and SWFExtract
# Ensure you have swfextract http://www.swftools.org/swfextract.html installed and in your path
# Ensure you have ffmpeg installed and in your path https://www.ffmpeg.org/
# Check if SWFextarct is installed and avaliable
command -v swfextract &>/dev/null || {
echo >&2 "I require swfextract but it's not installed. Aborting."
exit 1
var Destination = 6 //Destination in the TOC list, 4 is the first user created module after Overview, boomarks, Upcoming events, List of resources
var Origin = "Careers"
//Get the d2l refere
for (var key in D2L.OR.__g1) {
var obj = D2L.OR.__g1[key];
if (obj.toString().includes("d2l_referrer") === true) {
var d2l_referrer = (JSON.parse(obj).P[1])
@kerbeh
kerbeh / swfextract
Created October 25, 2018 02:00 — forked from oswaldoacauan/swfextract
SWFExtract All Files
#!/bin/sh
for i in ./*.swf ; do
for j in `swfextract $i | grep -E PNGs.* -o | grep -E [0-9]+ -o` ; do
echo "$i -> extract png $j";
swfextract -p "$j" "$i" -o "$i"_"$j".png
done
for j in `swfextract $i | grep -E JPEGs.* -o | grep -E [0-9]+ -o` ; do
echo "$i -> extract jpeg $j";
swfextract -j "$j" "$i" -o "$i"_"$j".jpg
done
@kerbeh
kerbeh / greenscren.md
Created September 25, 2018 00:17
Greenscreen chroma key with FFmpeg

##FFmpeg greenscreen process

ffmpeg -hwaccel videotoolbox -i background.jpg -i out.mp4 -filter_complex "[1:v]colorkey=0x34d454:0.3:0.15[ckout];[0:v][ckout]overlay[despill];[despill] despill=green[colorspace];[colorspace]format=yuv420p[out]" -map "[out]" output.mp4

###Explanation

*hwaccel enable hardware accelartion profile videotoolbok is avlaiable on my mac for this codec *-i is the input, the greenscreen video is second and the background image is first *-filter_complex chains up the filters in a string *colorkey provides the color of the green screen in hex, the threshold to match (higher is more) and the blend (higher is more)

<!-- Tile Starts Here -->
<!-- Wrap each Tile in a padded Div to add spacing -->
<div style="padding:0.5rem;">
<!-- Set img-url to the location of an image and that image will be auto centered in the tile -->
<!-- Add or remove the show-menu attribute to add or remove a menu -->
<d2l-image-tile img-url="/content/enforced/391623-TKS_BL_1/images/1474_Deakin-LAW-5.jpg" show-menu dropdown-aria-label="Tile Options">
<!-- Add any content here to be displayed below the tiles Image. Short Text is recomend but anytype of content is supported -->
<p>Law</p>
<!-- Menu starts here -->
<d2l-menu slot="d2l-image-tile-menu">
@kerbeh
kerbeh / blti-launch.php
Created March 1, 2018 05:24 — forked from matthanger/blti-launch.php
Sample code for Basic LTI Consumer in PHP
<?php
# ------------------------------
# START CONFIGURATION SECTION
#
$launch_url = "http://www.imsglobal.org/developers/BLTI/tool.php";
$key = "12345";
$secret = "secret";
$launch_data = array(
@kerbeh
kerbeh / EchoALPconfigBookmarklet.js
Created November 21, 2017 04:36
Echo360 ALP Device Room and IP config builder Bookmarklet
//** Echo ALP **/
//Scrape the rooms and IPs from the page
var ips = [...document.querySelectorAll("div.network span.type")].map(IP => `${IP.textContent}`);
var rooms = [...document.querySelectorAll("div.roomName")].map(Room => `${Room.textContent}`);
var configArray = {};
var alertString = "";
//Loop over the IPs and add the matching room
var count = 0;
for (ip of ips) {
@kerbeh
kerbeh / EchoESSconfigBookmarklet.js
Last active November 21, 2017 04:37
Echo360 ESS Device Room and IP config builder Bookmarklet
//Scrape the rooms and IPs from the page
var ips = [...document.querySelectorAll("a[id^='deviceUiLink']")].map(IP => `${IP.text}`);
var rooms = [...document.querySelectorAll("a[id^='showLink']")].map(Room => `${Room.text}`);
//Declare some containers to hold the data
var configArray = {};
var alertString = "";
//Loop over the IPs and add the matching room
var count = 0;
for (ip of ips) {
configArray[rooms[count].trim()] = ip;