Skip to content

Instantly share code, notes, and snippets.

View samdmarshall's full-sized avatar
💭
I will be slow to respond.

Samantha Demi samdmarshall

💭
I will be slow to respond.
View GitHub Profile
/* check that exp(i * pi) == -1 */
#include <math.h> /* for atan */
#include <stdio.h>
#include <complex.h>
#undef complex // complex.h has a macro define for "_Complex" -> "complex" which will break c++ compilation
int
main(void)
{
double pi = 4 * atan(1.0);
Samantha@Pegasus:~ $ brew update --debug --verbose
==> git symbolic-ref --short HEAD 2>/dev/null
master
==> git rev-parse -q --verify HEAD
9fea3da80f1510738aa92f2396a1be1d0c6cbd06
git config core.autocrlf false
git pull --ff --no-rebase origin refs/heads/master:refs/remotes/origin/master
Already up-to-date.
==> git rev-parse -q --verify HEAD
9fea3da80f1510738aa92f2396a1be1d0c6cbd06
--# Automator Action <Launch Application "Aperture">
--# Automator Action <Pause "5" "Minutes">
--# Automator Action <Run Applscript>
on run {input, parameters}
tell application "System Events"
tell process "Aperture"
--# make Aperture active
set frontmost to true
union {
id obj
float f
int i
bool b
BOOL B
char c
double d
uintptr_t p
} u;
// taken from https://opensource.apple.com/source/CF/CF-855.17/CFDate.c
CFAbsoluteTime CFAbsoluteTimeGetCurrent(void) {
CFAbsoluteTime ret;
struct timeval tv;
gettimeofday(&tv, NULL); // http://linux.die.net/man/2/gettimeofday
ret = (CFTimeInterval)tv.tv_sec - kCFAbsoluteTimeIntervalSince1970;
ret += (1.0E-6 * (CFTimeInterval)tv.tv_usec);
return ret;
}

in /Applications/Xcode.app/Contents/PlugIns/Xcode3Core.ideplugin/Contents/SharedSupport/Developer/Library/Xcode/Plug-ins/XCLanguageSupport.xcplugin/Contents/Resources/Swift.xcspec find the dictionary with identifier com.apple.xcode.tools.swift.compiler and under options add this:

{
	Name = "SWIFT_DEBUG_TIME_FUNCTION_BODIES";
	Type = Boolean;
	DefaultValue = YES;
	CommandLineArgs = {
		YES = (
			"-Xfrontend", "-debug-time-function-bodies",

);

int methImpl__UIQueuingScrollView__replaceViews_updatingContents_adjustContentInsets_animated_(int arg0, int arg1, int arg2, int arg3, int arg4, int arg5) {
eax = *__stack_chk_guard;
var_AC = eax;
var_10 = *eax;
eax = [arg_8 count];
edi = arg_0;
if (eax != 0x3) {
ebx = [(null) currentHandler];
eax = [(null) stringWithUTF8String:"/SourceCache/UIKit_Sim/UIKit-2935.98/_UIQueuingScrollView.m"];
eax = [ebx handleFailureInMethod:arg_4 object:edi file:eax lineNumber:0x17f description:@"Invalid parameter not satisfying: %s"];
# my_module/
# __init__.py
# Helpers/
# __init__.py
# plist_helper.py
# Foo/
# __init__.py
# foo.py
# Bar/
# __init__.py
#!/usr/bin/env sh
read -r -d '' script <<'EOF'
set working_dir_path to (do shell script "echo $PWD")
set working_dir to POSIX file working_dir_path
tell application "Xcode"
repeat with current_window in windows
repeat with workspace in documents of current_window
set workspace_name to name of workspace
import Foundation
var args = NSUserDefaults.standardUserDefaults().volatileDomainForName(NSArgumentDomain)
println(args);