Skip to content

Instantly share code, notes, and snippets.

View tbartelmess's full-sized avatar
🐶
EventLoopFuture<Void>

Thomas Bartelmess tbartelmess

🐶
EventLoopFuture<Void>
View GitHub Profile
@tbartelmess
tbartelmess / Attach to Xcode.scpt
Last active January 2, 2021 21:56
Apple Script to Attach Xcode to a Process
--- Usage: osascript [PATH TO SCRIPT] pid
on run argv
tell application "System Events"
tell process "Xcode"
set frontmost to true
click menu item "Attach to Process by PID or Name…" of menu "Debug" of menu bar 1
click first text field of sheet 1 of window 1
keystroke item 1 of argv
click button "Attach" of sheet 1 of window 1
end tell
### Keybase proof
I hereby claim:
* I am tbartelmess on github.
* I am tbartelmess (https://keybase.io/tbartelmess) on keybase.
* I have a public key ASAWYT6XzOADXiBDZvMQL5OIqd_-k96oLrtrXMyp5NmBMAo
To claim this, I am signing this object:
<?xml version="1.0" encoding="utf-8" ?>
<D:propfind xmlns:D="DAV:">
<D:prop>
<D:displayname/>
</D:prop>
</D:propfind>
@tbartelmess
tbartelmess / Collection-to-Dict.swift
Last active April 9, 2017 18:51
An extension to the Collection Type to create a dictionary using a transform closure.
extension Collection {
// Create a Dictionary from a collection using a transformer.
// The transformer function takes an element from the collection and returns a tuple
// with the key/value pair.
func dictionary<K, V>(transform:(_ element: Iterator.Element) -> (K, V)) -> [K : V] {
var dictionary = [K : V]()
self.forEach { element in
let (key, value) = transform(element)
dictionary[key] = value
}
#xcode Noise
build/*
*.pbxuser
*.mode2v3
*.mode1v3
*.xcworkspace
xcuserdata
# OSX Noise
.DS_Store
BEGIN:VTIMEZONE
TZID:Asia/Tokyo
BEGIN:DAYLIGHT
TZOFFSETFROM:+0900
RRULE:FREQ=YEARLY;UNTIL=19510505T170000Z;BYMONTH=5;BYDAY=1SU
DTSTART:19500507T020000
TZNAME:GMT+09:00
TZOFFSETTO:+1000
END:DAYLIGHT
BEGIN:STANDARD
BEGIN;
CREATE TABLE "cars_car" (
"id" integer NOT NULL PRIMARY KEY,
"model" varchar(200) NOT NULL,
"color" varchar(200) NOT NULL
)
;
CREATE TABLE "cars_person_cars" (
"id" integer NOT NULL PRIMARY KEY,
"person_id" integer NOT NULL,
// ==========================================================================
// Project: DesktopTimecard
// Copyright: ©2011 My Company, Inc.
// ==========================================================================
/*globals DesktopTimecard */
/** @namespace
My cool new app. Describe your application.
# Project: Controlpanel
# Copyright: ©2011 My Company, Inc.
# ===========================================================================
config :marketcircle,
:required => ['sproutcore/empty_theme'],
:theme_name => 'mc-theme',
:test_required => ['sproutcore/testing'],
:debug_required => ['sproutcore/debug']
@tbartelmess
tbartelmess / gist:861353
Created March 8, 2011 23:24
Syslogger for django
import syslog
from #YOUAPP# import settings
class SysLogging:
def __init__(self, facility, prefix=None):
self.facility = facility
if prefix:
syslog.openlog(prefix)
def _logit(self, priority, message):
syslog.syslog(self.facility | priority, '%s' % (message))