Skip to content

Instantly share code, notes, and snippets.

@oleganza
oleganza / NSObject+OASelectorNotifications.h
Created August 25, 2011 11:43
NSObject+OASelectorNotifications.h
/*
Oleg Andreev <oleganza@gmail.com>
January 25, 2011
With NSNotificationCenter you post notifications with a name like MyNotification.
Observer subscribes to this name with some selector like myNotification:
To make things easier and less verbose, we won't declare notification names, but only the selectors.
@michaljemala
michaljemala / tls-client.go
Last active November 12, 2024 23:20
SSL Client Authentication Golang sample
package main
import (
"crypto/tls"
"crypto/x509"
"flag"
"io/ioutil"
"log"
"net/http"
)
/// custom unique identifier
/// @see https://www.firebase.com/blog/2015-02-11-firebase-unique-identifiers.html
private let ASC_CHARS = Array("-0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz")
private let DESC_CHARS = ASC_CHARS.reverse()
private var lastPushTime: UInt64 = 0
private var lastRandChars = Array<Int>(count: 12, repeatedValue: 0)
func generatePushID(ascending: Bool = true) -> String {
let PUSH_CHARS = ascending ? ASC_CHARS: DESC_CHARS
var timeStampChars = Array<Character>(count: 8, repeatedValue: PUSH_CHARS.first!)
@mcastelino
mcastelino / Simple vsock setup for QEMU.md
Last active November 14, 2024 00:32
using qemu with vsock

Simple vsock setup for QEMU

Configuration

Host Kernel: rawhide 4.13.0-0.rc6.git4.2.fc28.x86_64 (on Fedora 24)

QEMU is mainline built from sources: QEMU emulator version 2.10.50 (v2.10.0-105-g223cd0e)

Guest: clear-17460-kvm.img (which has vsock support)

@esynr3z
esynr3z / e73-tbm-01_sch.md
Last active May 25, 2021 11:14
Test board E73-TBM-01

Can't find EBYTE test board E73-TBM-01 V1.0 schematic, so figured out connections by myself:

NRF52832 E73-2G4M04S1B Connected to
P0.05 21 CH340G CTS
P0.06 22 CH340G RX
P0.07 23 CH340G RTS
P0.08 24 CH340G TX
P0.13 29 SW2 (act. low)
P0.14 30 SW1 (act. low)