Skip to content

Instantly share code, notes, and snippets.

August "Gus" Mueller ccgus

Block or report user

Report or block ccgus

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View nodestyle.m
- (FJSValue*)evaluateModuleAtURL:(NSURL*)scriptURL {
if (scriptURL) {
NSError *error;
NSString *script = [NSString stringWithContentsOfURL:scriptURL encoding:NSUTF8StringEncoding error:&error];
if (script) {
#define NODE_STYLE_WRAPPER 1
#ifdef NODE_STYLE_WRAPPER
View AddCursor.jstalk
/*
How to install this plugin:
1) Choose Acorn's Help ▸ Open Acorn's App Support Folder menu item.
2) Place this script in the Plug-Ins folder (and make sure it ends with .jstalk)
3) Restart Acorn. The plugin will now show up in the Filter menu.
*/
function main(image, doc, layer) {
View gist:a475e2916f1e860b3b7dd2143862d5a5
var url = NSURL.fileURLWithPath_('/Library/Desktop Pictures/Yosemite.jpg');
var img = CIImage.imageWithContentsOfURL_(url)
var f = CIFilter.filterWithName_('CIColorInvert');
f.setValue_forKey_(img, kCIInputImageKey);
var r = f.outputImage();
var tiff = r.TIFFRepresentation();
tiff.writeToFile_atomically_('/tmp/foo.tiff', true);
NSWorkspace.sharedWorkspace().openFile_('/tmp/foo.tif');
View TSCreateImageFromIOSurface
void TSCreateImageFromIOSurfaceReleaseCallback(void * __nullable info, const void *data, size_t size);
void TSCreateImageFromIOSurfaceReleaseCallback(void * __nullable info, const void *data, size_t size) {
CFRelease(info);
}
CGImageRef TSCreateImageFromIOSurface(IOSurfaceRef surface, CGColorSpaceRef cs) {
View bring to front
NSWorkspace *workspace = [NSWorkspace sharedWorkspace];
NSDictionary *activeAppDict = [workspace activeApplication];
ProcessSerialNumber psn;
psn.highLongOfPSN = [[activeAppDict objectForKey:@"NSApplicationProcessSerialNumberHigh"] intValue];
psn.lowLongOfPSN = [[activeAppDict objectForKey:@"NSApplicationProcessSerialNumberLow"] intValue];
SetFrontProcess( &psn );
View gist:de321e5a00894f8f7df57b78d7468ba8
NSImageRep *originalCursorRep = [originalCursorImage bestRepresentationForRect:NSMakeRect(0, 0, [originalCursorImage size].width * retinaScale, [originalCursorImage size].height * retinaScale) context:nil hints:[NSDictionary dictionaryWithObject:[NSAffineTransform transform] forKey:NSImageHintCTM]];
View what.swift
import Cocoa
import ImageIO
import CoreGraphics
var cs = CGColorSpaceCreateDeviceRGB();
var bitmapOptions = CGBitmapInfo.byteOrder16Little.rawValue | CGImageAlphaInfo.premultipliedLast.rawValue;
var bitmapContext = CGContext(data: nil, width: 10, height: 10, bitsPerComponent: 16, bytesPerRow: 0, space: cs, bitmapInfo: bitmapOptions);
@ccgus
ccgus / gist:6c3c163ec7ec098bf618
Created Feb 17, 2016
11897314953572317650212638530309702051690633222946242004403237338917370055229707226164102903365288828535456978074955773144274431536702884341981255738537436786735932007069732632019159182829615243655295106467910866143117906321697788388961347865606003991487534332114549111600886798451548665128523401497730376000091254793939662231513836224178385427439…
View gist:6c3c163ec7ec098bf618
118973149535723176502126385303097020516906332229462420044032373389173700552297072261641029033652888285354569780749557731442744315367028843419812557385374367867359320070697326320191591828296152436552951064679108661431179063216977883889613478656060039914875343321145491116008867984515486651285234014977303760000912547939396622315138362241783854274391783813871780588948754057516822634765923557697480511372564902088485522249479139937758502601177354918009979622602685950855888360815984690023564513234659447638493985
View radar response
Hi August,
This is a courtesy email regarding Bug ID# 23538812.
Engineering has requested the following information in order to further investigate this issue:
- Please attach relevant crash logs to this bug report.
--- Crash Logs Instructions ---
https://developer.apple.com/bug-reporting/ios/crash/
View gist:91c9e7cad695ccdd0626
#import <Carbon/Carbon.h>
static OSStatus handleAppFrontSwitched(EventHandlerCallRef inHandlerCallRef, EventRef inEvent, void *inUserData);
EventHandlerRef MySkankyGlobalFrontAppSwitchedHandlerRef;
@implementation JSTWhatever
You can’t perform that action at this time.