Skip to content

Instantly share code, notes, and snippets.

Avatar

Pontus Jensen Karlsson wolfhechel

View GitHub Profile
View keybase.md

Keybase proof

I hereby claim:

  • I am wolfhechel on github.
  • I am jonet (https://keybase.io/jonet) on keybase.
  • I have a public key whose fingerprint is FC7D 72DD 49C8 B870 4FFA 82AA 6977 EFCF CE97 881B

To claim this, I am signing this object:

@wolfhechel
wolfhechel / kevent_notification_asyncio.py
Created Jul 7, 2016
Testing KEvent notifcations with asyncio
View kevent_notification_asyncio.py
import asyncio
import socket
import fcntl
import struct
import sys
SIOCSKEVFILT = 0x800c6502
@wolfhechel
wolfhechel / darwin_platform_uuid.py
Created Jul 7, 2016
ctypes implementation to retrieve platform UUID on OS X
View darwin_platform_uuid.py
from ctypes import *
from ctypes import util
from platform import mac_ver
import uuid
iokit = cdll.LoadLibrary(util.find_library('IOKit'))
cf = cdll.LoadLibrary(util.find_library('CoreFoundation'))
cf.CFStringCreateWithCString.argtypes = [c_void_p, c_char_p, c_int32]
@wolfhechel
wolfhechel / Makefile
Created Dec 4, 2015
Read AV format through libarchive
View Makefile
CFLAGS += -I$(shell brew --prefix libarchive)/include
CFLAGS += -I$(shell brew --prefix ffmpeg)/include
LDFLAGS += -L$(shell brew --prefix ffmpeg)/lib
LDFLAGS += -L$(shell brew --prefix libarchive)/lib
LDFLAGS += -larchive -lavformat -lavutil
av_archive_decode_OBJS=av_archive_decode.o
av_archive_decode: $(av_archive_decode_OBJS)
View av_archive_metadata.c
#include <stdlib.h>
#include <stdio.h>
#include <unistd.h>
#include <archive.h>
#include <archive_entry.h>
#include <libavformat/avformat.h>
View Vagrantfile
# -*- mode: ruby -*-
# vi: set ft=ruby :
# Vagrantfile API/syntax version. Don't touch unless you know what you're doing!
VAGRANTFILE_API_VERSION = '2'
Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
# All Vagrant configuration is done here. The most common configuration
# options are documented and commented below. For a complete reference,
# please see the online documentation at vagrantup.com.
@wolfhechel
wolfhechel / capabilities.py
Created Feb 28, 2015
ctypes changes between Python 2 and Python 3
View capabilities.py
import ctypes
import ctypes.util
def load_libcap(lib_name=None):
if lib_name is None:
lib_name = 'cap'
if not load_libcap.loaded_library:
libcap_name = ctypes.util.find_library(lib_name)
View keybase.md

Keybase proof

I hereby claim:

  • I am wolfhechel on github.
  • I am jonet (https://keybase.io/jonet) on keybase.
  • I have a public key whose fingerprint is EDCB CC0A C9B8 F6B4 F179 4B75 108B 16E8 B008 930D

To claim this, I am signing this object:

@wolfhechel
wolfhechel / pre-commit
Created Dec 5, 2014
Auto add Django migrations before commit
View pre-commit
find . -type d -name migrations -not -exec git check-ignore -q {} \; -exec git add {} \;
@wolfhechel
wolfhechel / autoexec.cfg
Created Nov 22, 2014
~/Library/Application Support/Steam/SteamApps/common/Counter-Strike Global Offensive/csgo/cfg/
View autoexec.cfg
// Weapon "movement" (behavior of your weapon, reduce gun and scope shifting)
cl_bobamt_lat 0.1
cl_bobamt_vert 0.1
cl_bobcycle 2 // 0.98 is enforced by ESEA/ESL
cl_viewmodel_shift_left_amt 0.5 // Reduce gun shifting when crouching
cl_viewmodel_shift_right_amt 0.5 // Reduce gun shifting when crouching
cl_bob_lower_amt 0
// Position the weapon closer to center to get a better view
viewmodel_offset_x 2