Skip to content

Instantly share code, notes, and snippets.

View mgerlach-klick's full-sized avatar

Maximilian Gerlach mgerlach-klick

  • Klick Health
  • Toronto
View GitHub Profile
// ==UserScript==
// @name no creepiness
// @namespace com.px0.klick
// @version 1
// @grant none
// ==/UserScript==
setInterval(function() {
jQuery('img[src$="/file/download?inline=true&GUID=79d2d216-c952-4af9-9f66-bd2a144b84b3"]').attr("src", "http://cutearoo.com/wp-content/uploads/2012/11/Puppy7.jpg");
}, 2000);
@mgerlach-klick
mgerlach-klick / Sanify Genome
Created July 13, 2015 18:59
Make Genome so I can actually see what's going on
@-moz-document domain('genome.klick.com') {
body, html {
font-size: 10pt;
/*line-height: 1.4;*/
font-family: Arial,sans-serif;
}
div.dashboard-grids .grid, div.dashboard-grids input, div.dashboard-grids textarea {
font-family: Arial,sans-serif;
@mgerlach-klick
mgerlach-klick / more better Genome!
Created July 13, 2015 20:07
More better Genome!
@-moz-document domain('genome.klick.com') {
body, html {
font-size: 10pt;
/*line-height: 1.4;*/
font-family: Arial,sans-serif;
}
div.dashboard-grids .grid, div.dashboard-grids input, div.dashboard-grids textarea {
font-family: Arial,sans-serif;
/* Shrink Genie */
.genie .genie-container .genie-context .genie-image > img {
width: 100px;
height: 100px;
}
.genie .genie-container .genie-context .genie-input, .genie .genie-container .genie-context .genie-image .genie-status {
font-size: 12px;
}
@mgerlach-klick
mgerlach-klick / gist:d04c1dc9f9be79ed31268133f79e7e03
Created June 28, 2016 19:46
community sdk / averagebandpowers
package com.emotiv.examples.AverageBandPowers;
import com.emotiv.Iedk.*;
import com.sun.jna.Pointer;
import com.sun.jna.ptr.*;
public class AverageBandPowers {
public static void main(String[] args) {
Pointer eEvent = Edk.INSTANCE.IEE_EmoEngineEventCreate();
Pointer eState = Edk.INSTANCE.IEE_EmoStateCreate();
@mgerlach-klick
mgerlach-klick / postgres-functions.clj
Last active October 21, 2018 16:23
simple `q` and `transact!` for postgres for people that know what they're doing and just want help with super simple CRUD
(defn q
"Queries a database by asking for a vector of namespaced keywords. Namespace = table, name = column. Snake/Kebab-cases where appropriate. Allows simple join maps, with the foreign key coming first. Allows :where, which is either a string, or a sql-vector for parameterized values [sql-expression val1 val2...], and :order-by which is a simple string, and :limit which takes an integer.
Example:
(q *db* [:customers/name :customers/address :invoice/id :invoice/date]
{:joins {:invoice/customerid :customers/id}
:where [\"customers.name like ? \" \"Max\"]
:order-by \"invoicd.date desc\"
:limit 2})
@mgerlach-klick
mgerlach-klick / db.py
Last active October 23, 2018 02:36
A simple data-based database access and update pattern for Python
import records
import re
def q(db, select, where=None, joins={}, order_by=None, limit=None, debug=False):
"""
Usage examples:
1) q(db, "phonebook.name phonebook.number", where=["phonebook.name=:name", {"name": "Dieter"}])
2) q(db, "phonebook.name, phonebook.number", where="phonebook.name='Dieter'")