Skip to content

Instantly share code, notes, and snippets.

Daniel Jalkut danielpunkass

Block or report user

Report or block danielpunkass

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 ToggleGrayscale.scpt
-- Line up a Python script for dynamically loading the private framework
-- and invoking the required private methods to get current grayscale mode
-- and set it to the opposite value.
set toggleGrayScript to "python -c 'from ctypes import cdll
lib = cdll.LoadLibrary(\"/System/Library/PrivateFrameworks/UniversalAccess.framework/UniversalAccess\")
lib.UAGrayscaleSetEnabled(lib.UAGrayscaleIsEnabled() == 0)
'"
do shell script toggleGrayScript
@danielpunkass
danielpunkass / gray.c
Created Apr 9, 2019
Standalone tool using private Apple framework to toggle display grayscale mode
View gray.c
#include <stdio.h>
// Compile with cc -o gray gray.c -framework UniversalAccess -F /System/Library/PrivateFrameworks
extern void UAGrayscaleSetEnabled(int isEnabled);
extern int UAGrayscaleIsEnabled();
int main() {
UAGrayscaleSetEnabled(!UAGrayscaleIsEnabled());
}
@danielpunkass
danielpunkass / xcbuild-debugging-tricks.md
Created Sep 14, 2018 — forked from ddunbar/xcbuild-debugging-tricks.md
Xcode new build system debugging tricks
View xcbuild-debugging-tricks.md

New Build System Tricks

Command Line

alias xcbuild=$(xcode-select -p)/../SharedFrameworks/XCBuild.framework/Versions/A/Support/xcbuild
# THIS DOESNT WORK YET: xcbuild openIDEConsole  # … then switch to Xcode ➡️
xcbuild showSpecs
xcbuild build <foo.pif> [—target <target>]
@danielpunkass
danielpunkass / ChangeKeyboard.m
Created Oct 6, 2015
Simple tool to change the selected input source to named keyboard...
View ChangeKeyboard.m
//
// main.m
// ChangeKeyboard
//
// Created by Daniel Jalkut on 10/6/15.
// Copyright © 2015 Red Sweater. All rights reserved.
//
#import <Foundation/Foundation.h>
#import <Carbon/Carbon.h>
View gist:22ebab43471758eb4f6b
<table class="loginBox withShadow" style="width:95%"><tbody class="loginCredentials">
<tr><td class="sidePadded" style="font-weight:bold; padding-top: 5px;"><p align="left"><font face="verdana,geneva,arial,sans-serif" size="4" color="green"><b>Welcome to Business Online Banking!</b></font></p></td></tr>
<tr><td><hr></td></tr>
<tr><td class="sidePadded">Company ID</td></tr>
<tr><td class="sidePadded"><input type="text" class="loginCredentials required" style="width:90%" id="companyID" name="companyID" size="20" value="" onkeypress="submitOnEnter(event);">
<br><span id="err_companyID">
</span></td></tr>
View gist:8d1fd90f149d2d09415a
echo "from AppKit import NSPasteboard\nprint NSPasteboard.pasteboardWithName_(\"IDESourceControlCommitMessagePasteboard\").stringForType_(\"IDESourceControlCommitMessagePboardType\")" | /usr/bin/python
View gist:2a553a1941e131cf7502
echo "from AppKit import NSPasteboard\nNSPasteboard.pasteboardWithName_(\"IDESourceControlCommitMessagePasteboard\").releaseGlobally()" | python
You can’t perform that action at this time.