Skip to content

Instantly share code, notes, and snippets.

@Wysie
Wysie / jQuery
Created May 23, 2014 02:35
AlchemyAPI jQuery API Call
//Hackish, using JSONP as JSON doesn't work. I wrote this portion for a Chrome extension and didn't see the need to host a server separately just to handle AlchemyAPI calls.
$.ajax({
url: 'https://access.alchemyapi.com/calls/text/TextGetTextSentiment',
dataType: 'jsonp',
jsonp: 'jsonp',
type: "post",
data: { apikey: 'APIKEYHERE', text: streamText, outputMode: 'json' },
success: function(res) {
if (res["status"] === "OK") {
@Wysie
Wysie / gist:03934b6a79a715772abd
Last active December 10, 2019 20:01
Upload to Amazon S3 Instead of Server for Sendy Email Image Uploads
//Using S3.php from https://github.com/tpyo/amazon-s3-php-class. Place it in includes/helpers
//Replaces Sendy's includes/create/upload.php
<?php
include('../functions.php');
include('../login/auth.php');
require_once('../helpers/S3.php');
//Init
$file = $_FILES['file']['tmp_name'];
@Wysie
Wysie / gist:7487571
Last active February 3, 2023 02:10
Script to route traffic from home network through VPN selectively.Based off the discussion at http://www.smallnetbuilder.com/forums/showthread.php?t=9311The setup is a Roku box, a Home PC running Plex, and a Synology NAS with a torrent client running a web interface.The aim is to have all traffic from Roku go through the VPN, all traffic from th…
#!/bin/sh
# Script to route traffic from home network through VPN selectively.
# Based off the discussion at http://www.smallnetbuilder.com/forums/showthread.php?t=9311
# The setup is a Roku box, a Home PC running Plex, and a Synology NAS with a torrent client running a web interface.
# The aim is to have all traffic from Roku go through the VPN, all traffic from the Home PC (and all other devices) bypassing the VPN,
# and the Synology NAS using the VPN. There are however some exceptions. Since Plex uses port 32400, Roku has to bypass the VPN when
# using that port. In addition, port 9091 has to bypass the VPN as well in order to access the Synology torrent client.
#
# Requirements: Asuswrt-Merlin with OpenVPN already set up
@Wysie
Wysie / usb_missile_launcher
Created November 30, 2013 03:27
Getting USB Missile Launcher to Work with Windows 7
Many years ago (probably 4 or 5), I purchased a USB Missile Launcher that looks like this: http://www.coolest-gadgets.com/wp-images/usbmissilelauncher.jpg
Unfortunately, it is not supported by Windows 7. It gets detected and installed as a device, but there's no software to run it. After some trial and error I managed to get it working, and here're the steps.
1. Download libusb-win32 Filter Driver: http://sourceforge.net/apps/trac/libusb-win32/
Filename should be something like libusb-win32-devel-filter-x.x.x.x.zip or libusb-win32-devel-filter-x.x.x.x.exe. Install it. Once installed, you should have a LibUSB-Win32 in your Start Menu. Within there, there should be a Filter Wizard. Open it.
2. Filter Wizard
Click on Install a device filter, and install all instances of your device (based on the pid and vid). You can find these values out by going to Device Manager, finding your device, clicking on Details, and then Hardware Ids.