Skip to content

Instantly share code, notes, and snippets.

View JFKingsley's full-sized avatar

Jonathan JFKingsley

View GitHub Profile
@JFKingsley
JFKingsley / status
Created October 21, 2014 09:32
OSX Status
#!/bin/bash
# Gets the *default* ip address only.
function default_ip
{
/usr/bin/ruby -e '
require "socket"
Socket.do_not_reverse_lookup = true

Keybase proof

I hereby claim:

  • I am jfkingsley on github.
  • I am jk (https://keybase.io/jk) on keybase.
  • I have a public key whose fingerprint is 62D8 1415 C45F B602 08F4 4C84 C9CE CDC4 D64F CA3C

To claim this, I am signing this object:

#!/bin/sh
# Based on gist.github.com/gboudreau/install-ffmpeg-amazon-linux.sh
# and https://trac.ffmpeg.org/wiki/CompilationGuide/Centos
if [ "`/usr/bin/whoami`" != "root" ]; then
echo "You need to execute this script as root."
exit 1
fi
cat > /etc/yum.repos.d/centos.repo<<EOF
@JFKingsley
JFKingsley / test.swift
Created October 20, 2016 11:18
Global hotkey registration
var gMyHotKeyID = EventHotKeyID()
gMyHotKeyID.signature = OSType("swat".fourCharCodeValue)
gMyHotKeyID.id = UInt32(keyCode)
var eventType = EventTypeSpec()
eventType.eventClass = OSType(kEventClassKeyboard)
eventType.eventKind = OSType(kEventHotKeyPressed)
// Install handler.
InstallEventHandler(GetApplicationEventTarget(), {(nextHanlder, theEvent, userData) -> OSStatus in
#include <iostream>
#include <memory>
#include <string>
#include <grpc++/grpc++.h>
#include "helloworld.grpc.pb.h"
using grpc::Server;
using grpc::ServerBuilder;
const int LIGHT_PIN = 9;
const int BUTTON_PIN = 5;
const int DIFFICULTY = 5;
int ledSequence[DIFFICULTY];
/**
* In this mode, the game shows the user a sequence to copy
*/
@JFKingsley
JFKingsley / Blame
Created October 29, 2013 23:08
A little git alias for quickly and easily blaming people.
To blame a user just do:
git add .
git blameuser Jake
To add this function just run:
git config alias.blameuser '!sh -c "git commit -m \"$1 managed to break something..\""' -
{
"name": "_name",
"version": "_version",
"description": "_description",
"author": "_author",
"triggers": "this is not a test",
"actions" : [
{
"say":"testing",
"bash":"open ~",
@JFKingsley
JFKingsley / Gist
Last active December 22, 2015 14:59
Stuff you need to install the YoutubeMediaMac extension for chrome
Dependencies: CMake
This project will install libwebsockets (if it is not already installed).
First download this: http://www.thebitguru.com/site_media/uploads/downloads/PlayButtoniTunesPatch-0.8.2.zip
Then double click and run Patch.command so iTunes doesnt boot when you press the play button
git clone --recursive git://github.com/whymarrh/media-keys.git
cd media-keys
./install.sh
from debian:wheezy
# Install Node.js
RUN apt-get update
RUN apt-get install -y curl
RUN curl -sL https://deb.nodesource.com/setup | bash -
RUN apt-get install -y nodejs
# Install hubot generator
RUN npm install -g yo generator-hubot