Skip to content

Instantly share code, notes, and snippets.

local ffi = require 'ffi'
ffi.load('/System/Library/Frameworks/Foundation.framework/Foundation', true)
ffi.cdef [[
typedef void * Method;
typedef void * id;
typedef void * Class;
typedef void * SEL;
Class objc_getClass(const char *name);
@rweichler
rweichler / cylinder.lua
Created March 25, 2016 22:39
cylinder in pure lua
local objc = require 'objc'
local ffi = require 'ffi'
ffi.cdef[[
void MSHookMessageEx(Class class, SEL message, void *hook, void *old);
typedef void (*func_t)(id, SEL, id);
]]
local log = function(x)
@rweichler
rweichler / EQE_hook.m
Last active July 18, 2016 23:27
Reference for people who want to add compatibility for EQE in their tweaks
static void (*orig_layoutSubviews)(id, SEL);
static void hook_layoutSubviews(UIView *self, SEL _cmd)
{
orig_layoutSubviews(self, _cmd);
if(_hookedSection) return;
UIView *controlCenter;
for(controlCenter = self.superview; controlCenter && ![controlCenter isKindOfClass:NSClassFromString(@"SBControlCenterSectionView")]; controlCenter = controlCenter.superview);
if(!controlCenter) return;
@rweichler
rweichler / objc.lua
Created July 29, 2016 06:02
LuaJIT objective-C runtime bindings
#!/usr/bin/env luajit
local ffi = require 'ffi'
local R = {}
local function framework(name)
return ffi.load("/System/Library/Frameworks/"..name..".framework/"..name, true)
end
--framework("Foundation")
--framework("UIKit")
In file included from /Users/reed/code/o/citra/externals/qhexedit/commands.cpp:1:
In file included from /Users/reed/code/o/citra/externals/qhexedit/commands.h:6:
In file included from /usr/local/opt/qt5/lib/QtWidgets.framework/Headers/QUndoCommand:1:
/usr/local/opt/qt5/lib/QtWidgets.framework/Headers/qundostack.h:57:5: error: 'QUndoCommandPrivate' does not refer to a value
QUndoCommandPrivate *d;
^
/usr/local/opt/qt5/lib/QtWidgets.framework/Headers/qundostack.h:50:7: note: declared here
class QUndoCommandPrivate;
^
/usr/local/opt/qt5/lib/QtWidgets.framework/Headers/qundostack.h:57:26: error: use of undeclared identifier 'd'
@rweichler
rweichler / output
Created November 9, 2016 21:24
find /usr/local/opt/qt5/
/usr/local/opt/qt5/
/usr/local/opt/qt5//.brew
/usr/local/opt/qt5//.brew/qt5.rb
/usr/local/opt/qt5//bin
/usr/local/opt/qt5//bin/canbusutil
/usr/local/opt/qt5//bin/fixqt4headers.pl
/usr/local/opt/qt5//bin/lconvert
/usr/local/opt/qt5//bin/lrelease
/usr/local/opt/qt5//bin/lupdate
/usr/local/opt/qt5//bin/macchangeqt
@rweichler
rweichler / stderr
Created November 10, 2016 05:57
citra error
In file included from /Users/reed/code/o/citra/externals/qhexedit/commands.cpp:1:
In file included from /Users/reed/code/o/citra/externals/qhexedit/commands.h:6:
In file included from /usr/local/opt/qt5/lib/QtWidgets.framework/Headers/QUndoCommand:1:
/usr/local/opt/qt5/lib/QtWidgets.framework/Headers/qundostack.h:57:5: error: 'QUndoCommandPrivate' does not refer to a value
QUndoCommandPrivate *d;
^
/usr/local/opt/qt5/lib/QtWidgets.framework/Headers/qundostack.h:50:7: note: declared here
class QUndoCommandPrivate;
^
/usr/local/opt/qt5/lib/QtWidgets.framework/Headers/qundostack.h:57:26: error: use of undeclared identifier 'd'

What I Wish I'd Known About Equity Before Joining A Unicorn

Disclaimer: This piece is written anonymously. The names of a few particular companies are mentioned, but as common examples only.

This is a short write-up on things that I wish I'd known and considered before joining a private company (aka startup, aka unicorn in some cases). I'm not trying to make the case that you should never join a private company, but the power imbalance between founder and employee is extreme, and that potential candidates would

#!/bin/bash
myAppPath=$(dirname "$0")
exec "$myAppPath"/dpkg.exe_ "$@"
jit.off()
local USE_C = true -- change this
PATH = '/var/root/test'
package.path = PATH..'/?.lua;'..
PATH..'/?/init.lua;'..
package.path
package.cpath = PATH..'/?.so;'..
package.cpath