Skip to content

Instantly share code, notes, and snippets.

Avatar

Timothy J. Wood tjw

View GitHub Profile
@huytd
huytd / wordle.md
Last active May 10, 2022
Wordle in less than 50 lines of Bash
View wordle.md

image

How to use:

./wordle.sh

Or try the unlimit mode:

@danielpunkass
danielpunkass / fsa.py
Last active Jul 22, 2018
A simple lldb module for adding an "fsa" command to inject F-Script anywhere into any process
View fsa.py
"""
Automate loading of F-Script Anywhere into any app.
By Daniel Jalkut - @danielpunkass - http://indiestack.com/
To set up:
0. Make sure you have FScript.framework installed in /Library/Frameworks (http://www.fscript.org)
1. Copy this script to ~/.lldb/fsa.py
2. Add the following to your ~/.lldbinit file:
@chrismiles
chrismiles / reveal.py
Last active Sep 2, 2021
Lazy script to wrap Reveal lib load/start commands in one LLDB command.
View reveal.py
""" File: reveal.py
Add to ~/.lldbinit:
command script import ~/.lldb-scripts/reveal.py
Q: Want to automatically load the Reveal lib on launch while debugging from Xcode?
A: In Xcode:
Add a Symbolic Breakpoint
Symbol: "UIApplicationMain"
Action: Debugger Command with value "reveal"
@depth42
depth42 / gist:6886194
Last active Dec 25, 2015
The xib compiler in Xcode 5.0.1 always sets the scaling bit of all NSViews which results in dramatically reduced performance. Until Apple fixes this severe bug, we work around this by patching NSKeyedUnarchiver to clear the bit during decoding of the compiled xib files. By the way: We filed this bug three months ago under rdar://14359398.
View gist:6886194
@interface NSKeyedUnarchiver (Xcode5Fix)
@end
@implementation NSKeyedUnarchiver (Xcode5Fix)
+ (void)load
{
[self exchangeInstanceMethod:@selector(decodeInt32ForKey:)
withMethod:@selector(xcode5Fix_decodeInt32ForKey:)];
}
@iloveitaly
iloveitaly / graffle2hash.rb
Created Dec 16, 2011
Convert Hierarchical OmniGraffle Document to JSON
View graffle2hash.rb
#!/usr/bin/env ruby
# rubycocoa
require 'osx/cocoa'
include OSX
OSX.require_framework 'ScriptingBridge'
class GraffleConverter
def initialize
@graffle = SBApplication.applicationWithBundleIdentifier_("com.omnigroup.OmniGraffle")
@mikeash
mikeash / gist:1264419
Created Oct 5, 2011
Ideas for with blocks for weak variables
View gist:1264419
// function
void with(id obj, void (^block)(id obj))
{
block(obj);
}
// example use
with(blah, ^(Blah *blah) {
// use blah here
});
@benstiglitz
benstiglitz / sys_param-better.h
Created Aug 11, 2011
Hygenic and shadow-safe MIN.
View sys_param-better.h
#define MIN_PASTE(A,B) A##B
#define MIN_IMPL(A,B,L) ({ __typeof__(A) MIN_PASTE(__a,L) = (A); __typeof__(B) MIN_PASTE(__b,L) = (B); MIN_PASTE(__a,L) < MIN_PASTE(__b,L) ? MIN_PASTE(__a,L) : MIN_PASTE(__b,L); })
#define MIN(A,B) MIN_IMPL(A,B,__COUNTER__)