Skip to content

Instantly share code, notes, and snippets.

View terhechte's full-sized avatar
💭
I may be slow to respond.

Benedikt Terhechte terhechte

💭
I may be slow to respond.
View GitHub Profile
@terhechte
terhechte / gist:4541442
Created January 15, 2013 19:52
Example of how to use the category key/value approach from my blogpost here: http://appventure.me/2011/12/fast-nsdictionary-traversal-in-objective-c.html
#import <Cocoa/Cocoa.h>
@interface NSDictionary (objectForKeyList)
- (id)objectForKeyList:(id)key, ...;
@end
@implementation NSDictionary (objectForKeyList)
- (id)objectForKeyList:(id)key, ...
{
@terhechte
terhechte / csstest1
Last active August 29, 2015 14:16
Test CSS
.iu-collection.cz-collection {
display: none !important;
visibility: hidden !important;
}
div.cz-container div.sc-push div.iu-collection {
display: none !important;
visibility: hidden !important;
}
.pm-category-active {
background-color: #000 !important;
@terhechte
terhechte / gist:a8059c45f259b7a5ba01
Created October 12, 2014 15:30
Implement "cond" expression (from Lisp) in Swift
//
// AppDelegate.swift
// testasdfsadf
//
// Created by Benedikt Terhechte on 10/12/14.
// Copyright (c) 2014 Benedikt Terhechte. All rights reserved.
//
import Cocoa
@terhechte
terhechte / gist:9699534
Created March 22, 2014 00:58
Use PKCS5_PBKDF2_HMAC_SHA1 from widthin Lua to decrypt aes128 with several roundtrips
functions = {}
aes = require("resty.aes")
local ffi = require "ffi"
ffi.cdef[[
int PKCS5_PBKDF2_HMAC_SHA1(const char *pass, int passlen,
const unsigned char *salt, int saltlen, int iter,
int keylen, unsigned char *out);
]]