Skip to content

Instantly share code, notes, and snippets.

Daniel Jalkut danielpunkass

View GitHub Profile
View UIView+RSKeyboardLayoutGuide.swift
// UIView+RSKeyboardLayoutGuide.swift
// RSTouchUIKit
// Created by Daniel Jalkut on 12/23/18.
import UIKit
// Extends UIView to expose a keyboardLayoutGuide property that can be used to tie a view controller's content
danielpunkass / RSDimensionHuggingTextField.swift
Created Oct 30, 2019
NSTextField subclasses that grow/shrink their width or height to fit text content
View RSDimensionHuggingTextField.swift
// RSDimensionHuggingTextField.swift
// RSUIKit
// Created by Daniel Jalkut on 6/13/18.
// Copyright © 2018 Red Sweater. All rights reserved.
import Cocoa
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 / 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() {
danielpunkass /
Created Sep 14, 2018 — forked from ddunbar/
Xcode new build system debugging tricks

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 / 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 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">
You can’t perform that action at this time.