Skip to content

Instantly share code, notes, and snippets.

View tedkulp's full-sized avatar

Ted Kulp tedkulp

View GitHub Profile
_ = require('lodash')
rpc = require('amqp-rpc').factory
url: "amqp://admin:changeme@192.168.100.10:5672"
exchange: "rpc_exchange"
rpc.on 'echo.*', (params, cb, callInfo) ->
if params.message
reply = {
echo: true
message: params.message
@tedkulp
tedkulp / after_chaining.js
Last active August 29, 2015 14:03
Code for "A few reasons to use Underscore.js (or Lo-Dash)"
function capAndJoinWords(aryOfWords) {
return _.chain(aryOfWords)
.map(function(item) { return item + '123'; })
.map(function(item) { return item.toUpperCase(); })
.reverse()
.value()
.join(' ');
}
capAndJoinWords(['array', 'this', 'in', 'are', 'words', 'test']); // "TEST123 WORDS123 ARE123 IN123 THIS123 ARRAY123"
@tedkulp
tedkulp / gist:5fc8563f906d501caa32
Created April 17, 2015 19:01
Cleanup removed/merged remote branches and the local branches that tracked them
alias grcl='git checkout master && git pull && git remote prune origin && git branch -avv | grep "gone]" | awk '\''{ print $1 }'\'' | xargs git branch -d'
@tedkulp
tedkulp / 44-my-devices.rules
Created May 1, 2015 11:18
Set /dev path on Raspberry Pi based on what USB port it's plugged into
SUBSYSTEM=="tty", ATTRS{devpath}=="1.2", ATTRS{idVendor}=="067b", ATTRS{idProduct}=="2303", SYMLINK+="topmatrix"
SUBSYSTEM=="tty", ATTRS{devpath}=="1.3", ATTRS{idVendor}=="067b", ATTRS{idProduct}=="2303", SYMLINK+="bottommatrix"
@tedkulp
tedkulp / update.sh
Last active November 1, 2017 13:48
Update containers in docker-compose file
#!/bin/bash
# Updates containers in a docker-compose file. If passed a name, it will
# just update that container. If no argument is given, it will update
# all the containers in the file. It must be run in a directory where a
# docker-compose command will work and see it's yaml config file.
#
# WARNING: It does remove and create the container, so be careful if you
# care about state that's not saved outside of the container.
#
@tedkulp
tedkulp / import_from_github.sh
Created July 16, 2020 14:02
Import a Github user's GPG into your keyring -- uses jq
#!/bin/sh
USERNAME=$1
curl https://api.github.com/users/$USERNAME/gpg_keys | jq -r '.[0].raw_key' | gpg --import
@tedkulp
tedkulp / stream_dummy_video.sh
Created September 20, 2021 00:13
Script to generate test video stream and stream to rtmp
#!/bin/bash
./videogen.sh -f flv "rtmp://some-rtmp-server:1935/live/some-key-maybe-goes-here"

[Verifying my cryptographic key: openpgp4fpr:AE6B007E2FAB1C94319C7C09FD56BE79CDAE7895]

@tedkulp
tedkulp / pastemeintoconsole.js
Last active December 28, 2022 14:56
Antimatter Dimensions - Tickspeed Challenge Helper
// Written by Anth42
// Antimatter Dimensions - Tickspeed Challenge Helper
// https://pastebin.com/ebTjWEFP
//
// Updated for 2022 by Ted Kulp
var jq = document.createElement('script');
jq.src = "https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js";
document.getElementsByTagName('head')[0].appendChild(jq);
@tedkulp
tedkulp / hb.js
Last active April 14, 2023 10:15
Get unredeemed keys in Humble Bundle
// Taken and modified from: https://reddit.com/r/humblebundles/comments/inm60w/meta_how_to_easily_pull_a_list_of_all_your/
// Run in dev console at: https://www.humblebundle.com/home/keys
// Target platform: Steam, GOG or OUYA
var targetPlatform = 'GOG';
//if you're not on the first page navigate to the first page
if($('.js-jump-to-page:first').text() != "1"){
$('.js-jump-to-page:nth-child(2)').click();
}