- Set Light mode
defaults write -g NSRequiresAquaSystemAppearance -bool Yes- Log out and log back in
- Set Dark mode
- Clone source code from: https://github.com/ccgus/CocoaScript
- Make
MOJavascriptObject.has public headers in Build Phases - Build project and we will get
CocoaScript.framework - Copy
CocoaScript.frameworkto your Xcode project
API.h
| 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 |
| // 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) { |
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
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;
}| import Darwin | |
| enum Signal: Int32 { | |
| case HUP = 1 | |
| case INT = 2 | |
| case QUIT = 3 | |
| case ABRT = 6 | |
| case KILL = 9 | |
| case ALRM = 14 | |
| case TERM = 15 |
LLDB comes with a great set of commands for powerful debugging.
Your starting point for anything. Type help to get a list of all commands, plus any user installed ones. Type 'help for more information on a command. Type help to get help for a specific option in a command too.
All of the below properties or methods, when requested/called in JavaScript, will trigger the browser to synchronously calculate the style and layout*. This is also called reflow or layout thrashing, and is common performance bottleneck.
Generally, all APIs that synchronously provide layout metrics will trigger forced reflow / layout. Read on for additional cases and details.
elem.offsetLeft,elem.offsetTop,elem.offsetWidth,elem.offsetHeight,elem.offsetParent
Comparing ES7 and core.async
| ES7 | core.async |
|---|---|
async function() {...} |
(fn [] (go ...)) |
await ... |
(<! ...) |
await* or Promise.all(...) |
(doseq [c ...] (<! c)) |