Value | Color |
---|---|
\e[0;30m | Black |
\e[0;31m | Red |
\e[0;32m | Green |
\e[0;33m | Yellow |
\e[0;34m | Blue |
\e[0;35m | Purple |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* ctrl-f1 | |
* ------- | |
* Query or toggle the "Full Keyboard Access" hotkey, Ctrl-F1 | |
* | |
* make CC=clang CFLAGS="-framework Carbon" ctrl-f1 | |
*/ | |
#include <Carbon/Carbon.h> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* To compile objective-c on the command line: | |
* | |
* gcc -framework Foundation objc-gcc.m | |
* | |
* You may have to link with -lobjc or other libs, | |
* as required. | |
*/ | |
#import <Foundation/Foundation.h> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- AppleScript -- | |
-- This example is meant as a simple starting point to show how to get the information in the simplest available way. | |
-- Keep in mind that when asking for a `return` after another, only the first one will be output. | |
-- This method is as good as its JXA counterpart. | |
-- Webkit variants include "Safari", "Webkit", "Orion". | |
-- Specific editions are valid, including "Safari Technology Preview". | |
-- "Safari" Example: | |
tell application "Safari" to return name of front document |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# UPDATED 17 February 2019 | |
# Redirect all HTTP traffic to HTTPS | |
server { | |
listen 80; | |
listen [::]:80; | |
server_name www.domain.com domain.com; | |
return 301 https://$host$request_uri; | |
} | |
# SSL configuration |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ObjC.import('Cocoa') | |
ObjC.import('WebKit') | |
MyWindow = WebViewWindow('http://www.youtube.com/') | |
MyWindow.makeKeyAndOrderFront(null) | |
//===================================================================== | |
function Window(x, y, width, height) { | |
let r = $.NSMakeRect(x, y, width, height) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ObjC.import('Cocoa') | |
ObjC.import('WebKit') | |
App = Application.currentApplication() | |
App.includeStandardAdditions = true | |
MyAction = SimpleSubclass('Action', { | |
quit(sender) { | |
App.quit() | |
}, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// main.m | |
// UniversalStatusBarClient | |
// | |
#import <Cocoa/Cocoa.h> | |
#import <IOKit/hid/IOHIDLib.h> | |
NSArray* keyMap[256]; | |
void fill_keyMap(NSArray * __strong map[]); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Darwin | |
// Call proc_listallpids once with nil/0 args to get the current number of pids | |
let initialNumPids = proc_listallpids(nil, 0) | |
// Allocate a buffer of these number of pids. | |
// Make sure to deallocate it as this class does not manage memory for us. | |
let buffer = UnsafeMutablePointer<pid_t>.allocate(capacity: Int(initialNumPids)) | |
defer { | |
buffer.deallocate() |
OlderNewer