Skip to content

Instantly share code, notes, and snippets.

View starhopp3r's full-sized avatar

Nikhil Raghavendra starhopp3r

View GitHub Profile
@starhopp3r
starhopp3r / linkers_101.md
Created November 18, 2018 14:38 — forked from jvns/linkers_101.md
How to understand what's in a binary, with code!

Step 0: A program, and prerequisites

We're going to be dealing with a "Hello, world!" program. Just one. There's going to be a bunch of fruit for discussion here. I'm going to be assuming you're on Linux, because we're gonna be talking about ELF and Macs use Mach-O and I don't know anything about Mach-O.

#include <stdio.h>

char *penguin = "Penguin";
char array[5] = {'a', 'b', 'c', 'd', 'e'};
@starhopp3r
starhopp3r / 00-dragndrop.swift
Created November 10, 2018 08:10 — forked from erica/00-dragndrop.swift
Building an OSX Drag and Drop Playground: Throw the dragndrop.swift into shared Sources and then test out the examples in individual playgrounds. Make sure the assistant is open and set to the timeline. I prefer vertical assistant stacking for this.
import Cocoa
// Support Foundation calls on String
public extension String { public var ns: NSString {return self as NSString} }
/// Custom Labeled Playground-Based Drag-and-Drop window
public class DropView: NSTextField {
// Default action handler
public var handler: ([String]) -> Void = { paths in Swift.print(paths) }