Skip to content

Instantly share code, notes, and snippets.

View fsmv's full-sized avatar

Andy Kallmeyer fsmv

View GitHub Profile
@fsmv
fsmv / hideApps.user.js
Created July 3, 2012 23:34
Android Developer Console - Hide Apps
// ==UserScript==
// @name Android Developer Console - Hide Apps
// @namespace http://fsmv.co.cc
// @description Allows the user to hide unpublished apps in the Android Developer Console so they don't have to look at them anymore.
// @version 0.8
// @include https://play.google.com/apps/publish/*
// @include http://play.google.com/apps/publish/*
// ==/UserScript==
var _timer = setInterval(onPageReady, 500);
@fsmv
fsmv / SoundSandbox.java
Last active October 24, 2022 17:28
A simple library for playing with sound generation and wav files
/**
* Copyright (C) 2012 Andrew Kallmeyer <ask@ask.systems>
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the “Software”), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
*
@fsmv
fsmv / wifi.sh
Last active December 11, 2015 14:58
A wifi utility for Mac that gets status and sets state. To use you have to place the airport binary in your path per these instructions http://osxdaily.com/2007/01/18/airport-the-little-known-command-line-wireless-utility/
#!/bin/bash
# Run this command to link airport into the path
# sudo ln -s /System/Library/PrivateFrameworks/Apple80211.framework/Versions/Current/Resources/airport /usr/sbin/airport
if [ "$1" == "status" ]
then
out=$(airport -I)
if [ "$out" == "AirPort: Off" ]
then
@fsmv
fsmv / .xbindkeysrc
Last active December 27, 2015 21:39
Set of scripts for a nice screenshot environment on linux Requires gnome-screenshot, notify-send, curl, and xclip Optionally depends on scrot for the scrn -s option
#On release because otherwise xbindkeys has problems with this command also using X at the same time
"scrn -a"
Release + Print
"scrn"
Release + Shift + Print
"scrn -s"
Release + Control + Print
@fsmv
fsmv / .vimrc
Last active October 17, 2022 14:05
my vim config
"
" Terminal Colors: http://terminal.sexy/#IyMjoKCgMDAw03CjbZ4_tYhYYJXFrHveO6J1z8_PaGho_6fao9Vy772LmMv-5bD_ddqp____
"
set nocompatible
filetype off
"Set up the Vundle plugin manager
set rtp+=~/.vim/bundle/Vundle.vim/
call vundle#rc()
@fsmv
fsmv / KDTree.h
Last active August 29, 2015 14:04
A K-D Tree implementation which preforms a nearest neighbor seach on any point type and returns the distance between them in any type using a user-defined distance function.
/**
* A K-D Tree implementation which preforms a nearest neighbor seach on any point type and returns the
* distance between them in any type using a user-defined distance function.
*
* Rather than returning the actual nearest object this class returns the index of the nearest object in
* the original vector that was passed in.
*
* Provided under the MIT License
* Copyright (c) 2014 Andrew Kallmeyer <fsmv@sapium.net>
*
@fsmv
fsmv / miniupnpcTest.c
Created September 12, 2014 19:47
Miniupnpc Port Forwarding Example
#include <stdio.h>
#include <arpa/inet.h> //INET6_ADDRSTRLEN
#include <miniupnpc/miniupnpc.h>
#include <miniupnpc/upnpcommands.h>
int main(int argc, char *argv[]) {
int error = 0;
//get a list of upnp devices (asks on the broadcast address and returns the responses)
struct UPNPDev *upnp_dev = upnpDiscover(1000, //timeout in milliseconds
NULL, //multicast address, default = "239.255.255.250"
@fsmv
fsmv / envinfo
Created March 12, 2015 04:34
Performance Testing Scripts
#!/bin/sh
echo "CPU Model: `grep -m1 'model name' /proc/cpuinfo | cut -d' ' -f3- | tr -s ' '`"
echo "CPU/Core Speed (MHz): `grep -m1 'cpu MHz' /proc/cpuinfo | cut -d' ' -f3` MHz"
echo "RAM: `grep 'MemTotal' /proc/meminfo | awk '{ print $2,$3 }'`"
echo "Operating System: `uname -sr`"
echo "Interconnect: N/A"
echo "g++ version: `g++ --version | head -1`"
echo "javac version: `javac -version 2>&1`"
echo "icpc version: `icpc --version | head -1`"
@fsmv
fsmv / logger.cpp
Created June 29, 2015 23:13
C++ Logger
/**
* The MIT License (MIT)
*
* Copyright (c) 2015 Andrew Kallmeyer
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
@fsmv
fsmv / build.bat
Created June 10, 2016 02:38
Loading and executing code directly from an obj file on Windows!
@echo off
rem Set up the Visual Studio 2013 compiler environment variables
call "C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\vcvarsall.bat" x64
cl -c lib.cpp
cl runner.cpp /link user32.lib