Skip to content

Instantly share code, notes, and snippets.

View ArthurYidi's full-sized avatar

Arthur Yidi ArthurYidi

  • San Francisco, California
View GitHub Profile
@bomberstudios
bomberstudios / README.md
Last active February 16, 2022 03:13
Loading a Cocoa Framework in a Sketch Plugin

This is what Craft does:

function loadFramework(pluginRoot) {
  if (NSClassFromString('PanelsManager') == null) {
    var mocha = [Mocha sharedRuntime];
    return [mocha loadFrameworkWithName:'Panels' inDirectory:pluginRoot];
  } else {
    return true;
 }
@darconeous
darconeous / os-x-syslog-server.md
Last active April 14, 2025 15:28
Using OS X as a Syslog Server

Using OS X as a Syslog Server

This document describes how to set up an OS X to be a syslog server that logs messages from the local network. It was largely meant for my own purposes so that I don't forget what I did, but feel free to use it for your own purposes.

A problem with just "turning this on" is that you will not see the correct hostname in the syslog entries. What we will do is use

// gif by dave aka @beesandbombs :)
int[][] result;
float t, c;
float ease(float p) {
return 3*p*p - 2*p*p*p;
}
float ease(float p, float g) {
@franjohn21
franjohn21 / generate-inverse-unicode-range.js
Created September 19, 2017 05:20
Inverse of critical unicode-range
const CharacterSet = require('characterset')
const critical = CharacterSet.parseUnicodeRange('U+00-A0,U+A9,U+AE,U+B2-B3,U+B9,U+2013-2014');
const all = CharacterSet.parseUnicodeRange('U+0000-FFFF');
const inverseOfCritical = all.difference(critical)
console.log(inverseOfCritical.toHexRangeString())
// => U+A1-A8,U+AA-AD,U+AF-B1,U+B4-B8,U+BA-2012,U+2015-FFFF
@phuochau
phuochau / callback_objc2cocoa.md
Last active April 11, 2018 23:40
Using callback from Objective-C to Cocoascript

Re-build cocoa framework

  • Clone source code from: https://github.com/ccgus/CocoaScript
  • Make MOJavascriptObject.h as public headers in Build Phases
  • Build project and we will get CocoaScript.framework
  • Copy CocoaScript.framework to your Xcode project

Define the objective-c methods with callback

API.h

Fixing macOS 10.14, 10.15, 12

Dark main menu without the rest of dark mode

  1. Set Light mode
  2. defaults write -g NSRequiresAquaSystemAppearance -bool Yes
  3. Log out and log back in
  4. Set Dark mode