Skip to content

Instantly share code, notes, and snippets.

View emehrkay's full-sized avatar
🏠
Working from home

Mark Henderson emehrkay

🏠
Working from home
View GitHub Profile
@emehrkay
emehrkay / ws.js
Last active May 4, 2021 10:43
simple webrtc video
class Video {
constructor(video){
this.video = video;
}
setStream(stream){
console.log('setting stream', stream)
this.video.srcObject = stream;
this.video.play();
}
@emehrkay
emehrkay / classic.lua
Last active August 4, 2018 14:41
simple love2d box with arrow controls
--
-- classic
--
-- Copyright (c) 2014, rxi
--
-- This module is free software; you can redistribute it and/or modify it under
-- the terms of the MIT license. See LICENSE for details.
--
@emehrkay
emehrkay / init.lua
Created July 15, 2016 00:58
Hammer spoon display sleep when Dolphin is open
function applicationWatcher(appName, eventType, appObject)
if (appName == "Dolphin") then
if (eventType == hs.application.watcher.launched) then
hs.caffeinate.set('displayIdle', true)
elseif (eventType == hs.application.watcher.terminated) then
hs.caffeinate.set('displayIdle', false)
end
end
end
@emehrkay
emehrkay / gremlinconn.swift
Last active June 6, 2016 13:01
Quick Gremlin test from Swift
import Cocoa
class GremlinConnection{
var host : String = ""
var port : String = "8182"
var processor : String = ""
var op : String = "eval"
var request : NSMutableURLRequest?
var web_socket : WebSocket?
@emehrkay
emehrkay / test.py
Last active April 20, 2016 04:06
Marko's example wrapping Gremlinpy
from gremlinpy.gremlin import *
from gremlinpy.gremlin import _, __
class PythonStringGraphTraversalSource(object):
def __init__(self, graph_variable):
self.graph_variable = graph_variable
self.gremlin = Gremlin(self.graph_variable)