Skip to content

Instantly share code, notes, and snippets.

View kfix's full-sized avatar
🚲
spinning wheels

Joey Korkames kfix

🚲
spinning wheels
View GitHub Profile
@chrox
chrox / KPVBooklet.java
Created December 6, 2012 13:22
run KPV as a kindle booklet
package com.github.chrox.kpvbooklet;
import java.io.IOException;
import java.lang.reflect.Field;
import java.net.URI;
import java.util.Date;
import org.json.simple.JSONObject;
import org.json.simple.JSONArray;
@ytjohn
ytjohn / GPG-Salt-Prod.md
Created January 29, 2016 15:01
GPG-Salt-Prod.md

GPG In Pillar

Include this file in the git repo with your pillar data. It provides instructions for those commiting code to securely save and commit senstive data (like password and private certs).

This the Salt Prod key:

key A1234567: "Salt Prod salt.prod@mailinator.com"

@makotom
makotom / ndpproxy.sh
Last active June 17, 2016 04:44
Yet another implementation of IPv6 pass-through
#/usr/bin/bash
WANDEV='eth0'
LANDEV='br0'
while :
do
ip -6 neigh show dev $LANDEV | grep lladdr | grep -v -P ^fe80:: | sed -e 's/ .*$//' | while read addr
do
if [ "$(ip -6 neigh show proxy to $addr dev $WANDEV)" == "" ]
@whiteinge
whiteinge / saltshell.py
Last active November 30, 2016 01:29
The planning stages of a for-development shell environment for Salt
#!/usr/bin/env python
'''\
Welcome to the Salt repl which exposes the execution environment of a minion in
a pre-configured Python shell
__opts__, __salt__, __grains__, and __pillar__ are available.
Jinja can be tested with full access to the above structures in the usual way:
JINJA("""\\
@marktheunissen
marktheunissen / stunnel-systemd-socket.patch
Last active March 7, 2017 23:50
Stunnel patch for systemd socket activation
diff a/configure.ac b/configure.ac
--- a/configure.ac
+++ b/configure.ac
@@ -478,8 +478,18 @@ if test "$fips" = "auto"; then
])
fi
+# Check for systemd support for socket activation.
+AC_CHECK_LIB(systemd-daemon, sd_notify, SYSTEMD_LIBS="-lsystemd-daemon")
+AC_CHECK_HEADERS(systemd/sd-daemon.h)
@arosenb2
arosenb2 / BasicChildBrowser.swift
Last active September 9, 2017 20:50
A child web browser without navigation features in iOS using WKWebView in Swift
import Foundation
import UIKit
import Webkit
class BasicChildBrowser:UIViewController, WKNavigationDelegate {
let web = WKWebView()
let toolbar = UIToolbar()
let progressSpinner = UIActivityIndicatorView(activityIndicatorStyle: .White)
let progressBar = UIProgressView(progressViewStyle: .Bar)
@southwolf
southwolf / Pebble.ino
Last active January 26, 2020 20:40
Arduino code for Communicate with Pebble
#include <string.h>
#include <ctype.h>
#include <SoftwareSerial.h>
// the Bluetooth Shield connects to Pin D9 & D10
SoftwareSerial bt(9,10);
const uint8_t req[5] = {0x00, 0x01, 0x00, 0x11, 0x00};
const uint8_t cap[17] = {0x00, 0x0d, 0x00, 0x11, 0x01, 0xff, 0xff, 0xff, 0xff, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x32};
const uint8_t ping[9] = {0x00, 0x05, 0x07, 0xd1, 0x00, 0xde, 0xad, 0xbe, 0xef};
@leonbreedt
leonbreedt / CustomPropertyJSValueLifetime.swift
Last active January 21, 2021 17:00
JavaScriptCore custom property JSValue lifetime
import Cocoa
import JavaScriptCore
/// Something that can be represented as a `JSValue`.
protocol JSValueRepresentable {
/// The `JSValue` for this thing.
var jsValue: JSValue { get }
}
@vilhalmer
vilhalmer / gist:3052f7e9e7f34b92a40f
Created November 1, 2014 01:28
NSVisualEffectView undocumentation
NSVisualEffectMaterial constants, and the undocumented materials they coorespond to in various modes:
+----------------------+-------+----------+------+---------+
| MATERIAL # | LIGHT | LIGHT EM | DARK | DARK EM |
+----------------------+-------+----------+------+---------+
| | | | | |
| 0 - Appearance Based | 3 | 3 | 5 | 5 |
| | | | | |
| 1 - Light | 3 | 3 | 3 | 3 |
| | | | | |
| 2 - Dark | 4 | 4 | 4 | 4 |
@DrewML
DrewML / Theming-Slack-OSX.md
Last active January 25, 2022 00:53
Theming Slack for OSX

Theming Slack for OSX

So, you love Slack, but you hate applications with large white backgrounds? Why not use Dark Mode!

Unfortunately, Slack does not have a Dark Mode, although it's on their list of possibilities.

But, don't fret - there is a solution! Because the slack native desktop apps are just wrappers around a web app, we can inject our own CSS to customize the application to our liking.

How to (OSX Only)