Skip to content

Instantly share code, notes, and snippets.

View irlabs's full-sized avatar

Dirk van Oosterbosch irlabs

View GitHub Profile
@irlabs
irlabs / xed.sh
Created November 11, 2016 08:25 — forked from dunkelstern/xed.sh
xed "reimplementation" to fix broken Xcode 4 xed
#!/bin/bash
if [ "$1" = "-l" ] || [ "$1" = "--line" ] ; then
line=$2
file=$3
else
line=1
file=$1
fi
@irlabs
irlabs / gist:58aed5c5394485c0780ffb78f774f582
Last active June 9, 2017 10:04 — forked from akirahrkw/gist:ce3c52ae79f3b5de5a01
Manipulate pixel data in swift 3.0
class BaseImageProcessor {
func createARGBBitmapContext(image: CGImage) -> CGContext? {
let pixelWidth = image.width
let pixelHeight = image.height
let bitmapBytesPerRow = pixelWidth * 4
let bitmapByteCount = bitmapBytesPerRow * pixelHeight
let bitmapData: UnsafeMutableRawPointer = malloc(bitmapByteCount)
let colorSpace: CGColorSpace = CGColorSpaceCreateDeviceRGB()