Skip to content

Instantly share code, notes, and snippets.

View jbradforddillon's full-sized avatar

Bradford jbradforddillon

  • Stable Kernel
  • Atlanta
View GitHub Profile
// ==UserScript==
// @name Open PRs
// @description Opens all PRs in new tabs
// @match *://github.com/pulls
// @match *://github.com/pulls*
// @match *://github.com/**/pulls*
// @match *://github.com/**/pulls
// @require https://code.jquery.com/jquery-3.6.0.min.js
// ==/UserScript==
extension View {
public func stackingSheet<Item, Content>(item: Binding<Item?>, onDismiss: (() -> Void)? = nil, @ViewBuilder content: @escaping (Item) -> Content) -> some View where Item : Identifiable, Content : View {
return self.background(EmptyView().sheet(item: item, onDismiss: onDismiss, content: content))
}
public func stackingSheet<Content>(isPresented: Binding<Bool>, onDismiss: (() -> Void)? = nil, @ViewBuilder content: @escaping () -> Content) -> some View where Content : View {
return self.background(EmptyView().sheet(isPresented: isPresented, onDismiss: onDismiss, content: content))
}
}

Keybase proof

I hereby claim:

  • I am jbradforddillon on github.
  • I am jbradforddillon (https://keybase.io/jbradforddillon) on keybase.
  • I have a public key ASAlbSGlRGttBA_JpRd9YLwBHjUv-j87gEk5-CIG4AwZAAo

To claim this, I am signing this object:

let viewController = UIViewController()
var b: (Bool) -> Void = {
(var cancelled) -> Void in
viewController.dismissViewControllerAnimated(true, completion: nil)
// dismissViewControllerAnimated returns Void, no problem.
}
var b: (Bool) -> Void = {
(var cancelled) -> Void in
viewController.navigationController.popViewControllerAnimated(true)
@jbradforddillon
jbradforddillon / Stubby.py
Last active August 29, 2015 13:57
Super simple implementation stubber. Point it at a .h file.
#!/usr/bin/env python
import sys
f = open(sys.argv[1])
output = ""
for line in f:
if line[0:10] == "@interface":
colonIndex = line.find(":")
implLine = line
// Classic delegation
- (void)myOperationDidSucceed:(id data) {
[myView hideLoadingIndicator];
// Do something with data
}
- (void)myOperationDidFail:(NSError *)error {
[myView hideLoadingIndicator];
// Do something with the error
}
@jbradforddillon
jbradforddillon / gist:5302387
Created April 3, 2013 15:45
Stick it in your .bash_profile
if [ -f ~/.git-prompt.sh ]; then
. ~/.git-prompt.sh
fi
GIT_PS1_SHOWDIRTYSTATE=true
GIT_PS1_SHOWSTASHSTATE=true
GIT_PS1_SHOWUNTRACKEDFILES=true
if [ -f /opt/local/etc/bash_completion ]; then
. /opt/local/etc/bash_completion
// Used to highlight a view, often to encourage a client decision
#define Uglify(view) view.backgroundColor = [UIColor magentaColor]
// Used to make missing graphics unmistakable
#define MissingGraphic(width, height) [UIImage imageWithData:[NSData dataWithContentsOfURL:[NSURL URLWithString:[NSString stringWithFormat:@"http://placekitten.com/%i/%i", width, height]]]]
// Used to indicate incomplete functionality or known issues.
#define DangerZone(message) [[[UIAlertView alloc] initWithTitle:@"Welcome to the Danger Zone" message:message delegate:nil cancelButtonTitle:@"Ok" otherButtonTitles:nil] show]
@jbradforddillon
jbradforddillon / timestampHeader.py
Created March 29, 2012 02:32
timestampHeader.py
# timestampHeader.py
import datetime
import sublime, sublime_plugin
class TimestampheaderCommand(sublime_plugin.TextCommand):
def run(self, edit):
id_attr = "e%s" % datetime.datetime.now().strftime("%Y%m%d%H%M")
timestamp = datetime.datetime.now().strftime("%A, %B %d %Y @ %r")
header = "<h3 id=\"%s\"><a href=\"#%s\">%s</a></h3>" % (id_attr, id_attr, timestamp)