Skip to content

Instantly share code, notes, and snippets.

@schlamar
schlamar / main.go
Created Apr 14, 2019
go GPIO chardev example
View main.go
package main
import (
"encoding/hex"
"os"
"syscall"
"time"
"unsafe"
"golang.org/x/sys/unix"
@schlamar
schlamar / main.go
Created Apr 4, 2019
GPIO read performance test
View main.go
package main
import (
"fmt"
"runtime/debug"
"sort"
"time"
"periph.io/x/periph/conn/gpio/gpioreg"
"periph.io/x/periph/host"
View gist:29a9d4be6b061a27dcfa
Dr. Memory version 1.8.0 build 8 built on Sep 9 2014 16:27:02
Dr. Memory results for pid 20340: "run-tests.exe"
Application cmdline: ""c:\Users\schlaich\Desktop\libuv\Debug\run-tests.exe" fs_stat_missing_path fs_stat_missing_path"
Recorded 108 suppression(s) from default C:\Users\schlaich\Desktop\Apps\DrMemory\bin\suppress-default.txt
===========================================================================
FINAL SUMMARY:
DUPLICATE ERROR COUNTS:
View gist:6d7a404cdc128de49df9
0:000:x86> !analyze -v
*******************************************************************************
* *
* Exception Analysis *
* *
*******************************************************************************
FAULTING_IP:
python27!PyEval_EvalFrameEx+273 [c:\build27\cpython\python\ceval.c @ 1057]
View keybase.md

Keybase proof

I hereby claim:

  • I am schlamar on github.
  • I am schlamar (https://keybase.io/schlamar) on keybase.
  • I have a public key whose fingerprint is CC55 6FAF D135 81EF 89F6 C671 E5AA 0181 2304 FE32

To claim this, I am signing this object:

View process_hooks.py
class Func(object):
_on_start = list()
_on_exit = list()
@classmethod
def register_on_start(cls, callback):
cls._on_start.append(callback)
@schlamar
schlamar / gist:7921ec587dd58a72a6d6
Last active Aug 26, 2016
zmq + SetConsoleCtrlHandler
View gist:7921ec587dd58a72a6d6
from ctypes import WINFUNCTYPE, windll
from ctypes.wintypes import BOOL, DWORD
import zmq
kernel32 = windll.LoadLibrary('kernel32')
PHANDLER_ROUTINE = WINFUNCTYPE(BOOL, DWORD)
SetConsoleCtrlHandler = kernel32.SetConsoleCtrlHandler
@schlamar
schlamar / conf.ini
Last active Aug 29, 2015
Click: override default options with config file(s)
View conf.ini
[test]
count = 2
View prefork_pyuv.py
import functools
import os
import socket
import time
import pyuv
def on_connection(message, handle, loop):
@schlamar
schlamar / gist:8519530
Created Jan 20, 2014
WSAAccept with Python and ctypes
View gist:8519530
import errno
import multiprocessing
import socket
import time
import ctypes
from ctypes import windll
from ctypes import POINTER, WINFUNCTYPE, c_char_p, c_char, c_int, c_ushort
from ctypes.wintypes import DWORD, UINT, INT, ULONG