Skip to content

Instantly share code, notes, and snippets.

View orklann's full-sized avatar
🏠
Working from home

rkt orklann

🏠
Working from home
View GitHub Profile
@orklann
orklann / snapshot.swift
Created December 26, 2020 08:47 — forked from kaishin/snapshot.swift
NSView Snapshot
extension NSView {
var snapshot: NSImage {
guard let bitmapRep = bitmapImageRepForCachingDisplayInRect(bounds) else { return NSImage() }
bitmapRep.size = bounds.size
cacheDisplayInRect(bounds, toBitmapImageRep: bitmapRep)
let image = NSImage(size: bounds.size)
image.addRepresentation(bitmapRep)
return image
}
}
@orklann
orklann / CGFontToFontData.m
Created October 21, 2020 07:12 — forked from Bokugene/CGFontToFontData.m
Read Table Data from a CGFont, then wrap them into a OTF/TTF font.
typedef struct FontHeader {
int32_t fVersion;
uint16_t fNumTables;
uint16_t fSearchRange;
uint16_t fEntrySelector;
uint16_t fRangeShift;
}FontHeader;
typedef struct TableEntry {
uint32_t fTag;
@orklann
orklann / install_diablo2_on_mac.md
Last active September 7, 2021 08:18 — forked from whipowill/install_diablo2_on_mac.md
Install Diablo II on Mac OSX

Install Diablo II on Mac OSX

These are the instructions for using Terminal to install the Windows version of the game onto your machine. You can then easily copy the game multiple times for different mods you might want to play.

In this guide you'll end up with:

  • A version of the unadulterated game
  • A single-player install w/ PlugY

Install Wine

@orklann
orklann / unfollow.js
Created August 13, 2020 06:14 — forked from JamieMason/unfollow.js.md
Unfollow everyone on twitter.com
// Unfollow everyone on twitter.com, by Jamie Mason (https://twitter.com/fold_left)
// https://gist.github.com/JamieMason/7580315
//
// 1. Go to https://twitter.com/YOUR_USER_NAME/following
// 2. Open the Developer Console. (COMMAND+ALT+I on Mac)
// 3. Paste this into the Developer Console and run it
//
// Last Updated: 09 April 2020
(() => {
const $followButtons = '[data-testid$="-unfollow"]';
Chrome Web Store
Dear Developer,
Your Google Chrome item "Pushbullet" with ID:
chlffgpmiacpedhhbkiomidkjlcfhogd did not comply with our policies.
Your item is still published, but is at risk of being removed from the
Chrome Web Store.
@orklann
orklann / client.html
Created February 11, 2020 06:05 — forked from ericremoreynolds/client.html
Flask-socket.io emit to specific clients
<html>
<body>
<h1>I feel lonely</h1>
<script type="text/javascript" src="//code.jquery.com/jquery-2.1.3.min.js"></script>
<script type="text/javascript" src="//cdnjs.cloudflare.com/ajax/libs/socket.io/0.9.16/socket.io.min.js"></script>
<script type="text/javascript" charset="utf-8">
var socket = io.connect('http://' + document.domain + ':' + location.port);
socket.on('connect', function() {
socket.emit('connected');
# ##### BEGIN GPL LICENSE BLOCK #####
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
@orklann
orklann / setup_bpy.sh
Created July 25, 2018 09:23 — forked from xunkai55/setup_bpy.sh
Setup bpy (Blender as a python module) on Mac OS X
# Do not excute the script directly. It is just for demonstration.
# If you followed the documentation and got the errors below, please take a look at this guide.
# Color management: using fallback mode for management
# bpy: couldnt find 'scripts/modules', blender probably wont start.
# Freestyle: couldn't find 'scripts/freestyle/modules', Freestyle won't work properly.
# ImportError: No module named 'bpy_types'
# ImportError: No module named 'bpy_types'
# pyrna_srna_ExternalType: failed to find 'bpy_types' module
# ImportError: No module named 'bpy_types'
@orklann
orklann / hello_world.py
Created May 22, 2018 09:37 — forked from uchcode/hello_world.py
pyobjc example.
#!/usr/bin/python2.6
# -*- coding: utf-8 -*-
import objc
from Foundation import *
from AppKit import *
from PyObjCTools import AppHelper
NSWindowDelegate = objc.protocolNamed("NSWindowDelegate")
@orklann
orklann / node.dart
Created July 6, 2017 08:55 — forked from azenla/node.dart
Node.js Interop
library nodejs;
import "dart:js";
/**
* Simple Helper Class
*/
class Console {
void log(String message) => context['console'].callMethod("log", [message]);