Skip to content

Instantly share code, notes, and snippets.

View wolfhechel's full-sized avatar

Pontus Jensen Karlsson wolfhechel

View GitHub Profile
@wolfhechel
wolfhechel / NSArray+firstObject.h
Created October 7, 2013 08:08
Butloads of Categories
//
// NSArray+firstObject.h
//
// Created by Pontus Carlsson on 2013-10-02.
//
#import <Foundation/Foundation.h>
@interface NSArray (firstObject)
http://ftp.gnu.org/gnu/binutils/binutils-2.24.tar.bz2
http://ftp.gnu.org/gnu/gcc/gcc-4.8.2/gcc-4.8.2.tar.bz2
http://www.multiprecision.org/mpc/download/mpc-1.0.2.tar.gz
http://www.mpfr.org/mpfr-3.1.2/mpfr-3.1.2.tar.xz
http://ftp.gnu.org/gnu/gmp/gmp-6.0.0a.tar.xz
https://www.kernel.org/pub/linux/kernel/v3.x/linux-3.14.tar.xz
http://ftp.gnu.org/gnu/glibc/glibc-2.19.tar.xz
http://prdownloads.sourceforge.net/tcl/tcl8.6.1-src.tar.gz
http://prdownloads.sourceforge.net/expect/expect5.45.tar.gz
http://ftp.gnu.org/gnu/dejagnu/dejagnu-1.5.1.tar.gz
import socket
import os
def make_local_sock_path(sock: socket.socket):
return '/tmp/wpa_ctrl_{}-{}'.format(os.getpid(), sock.fileno())
def prepare_wpa_ctrl_socket(ctrl_path: str, local_sock_path=make_local_sock_path):
sock = socket.socket(socket.AF_UNIX, socket.SOCK_DGRAM, 0)
bind_path = local_sock_path(sock)
@wolfhechel
wolfhechel / autoexec.cfg
Created November 22, 2014 09:49
~/Library/Application Support/Steam/SteamApps/common/Counter-Strike Global Offensive/csgo/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
@wolfhechel
wolfhechel / pre-commit
Created December 5, 2014 10:19
Auto add Django migrations before commit
find . -type d -name migrations -not -exec git check-ignore -q {} \; -exec git add {} \;
@wolfhechel
wolfhechel / keybase.md
Created February 26, 2015 08:49
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 / capabilities.py
Created February 28, 2015 07:54
ctypes changes between Python 2 and Python 3
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)
@wolfhechel
wolfhechel / Vagrantfile
Created March 14, 2015 13:23
nftables router
# -*- 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.
#include <stdlib.h>
#include <stdio.h>
#include <unistd.h>
#include <archive.h>
#include <archive_entry.h>
#include <libavformat/avformat.h>
@wolfhechel
wolfhechel / Makefile
Created December 4, 2015 08:16
Read AV format through libarchive
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)