This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // | |
| // NSObject+BlockObservation.h | |
| // Version 1.0 | |
| // | |
| // Andy Matuschak | |
| // [email protected] | |
| // Public domain because I love you. Let me know how you use it. | |
| // | |
| #import <Cocoa/Cocoa.h> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/sh | |
| # This program has two feature. | |
| # | |
| # 1. Create a disk image on RAM. | |
| # 2. Mount that disk image. | |
| # | |
| # Usage: | |
| # $0 <dir> <size> | |
| # |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #import "SenTestCase+MethodSwizzling.m" | |
| @interface ExampleTest : SenTestCase {} | |
| + (BOOL)trueMethod; | |
| + (BOOL)falseMethod; | |
| @end | |
| @implementation ExampleTest | |
| + (BOOL)trueMethod { return YES; } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env python | |
| """ | |
| Very simple HTTP server in python (Updated for Python 3.7) | |
| Usage: | |
| ./dummy-web-server.py -h | |
| ./dummy-web-server.py -l localhost -p 8000 | |
| Send a GET request: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env sh | |
| ## | |
| # This is script with usefull tips taken from: | |
| # https://github.com/mathiasbynens/dotfiles/blob/master/.osx | |
| # | |
| # install it: | |
| # curl -sL https://raw.github.com/gist/2108403/hack.sh | sh | |
| # |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/sh | |
| ## | |
| # Copyright 2008 Apple Inc. | |
| # All rights reserved. | |
| # | |
| # iPhoneSimulator platform | |
| # This script runs all of the unit tests for the target test bundle specified by the passed-in environment. | |
| # This script is generally intended to be invoked by ${DEVELOPER_TOOLS_DIR}/RunUnitTests. The interface or location of this script may change in future releases. | |
| ## | |
| # |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| @synthesize firstName = _firstName; | |
| @synthesize txtFirstName = _txtFirstName; | |
| [RACAbleSelf(self.firstName) subscribeNext:^(id x) { [self firstNameChanged:x]; }]; | |
| [self rac_bind:RAC_KEYPATH_SELF(self.firstName) to:self.txtFirstName.rac_textSubscribable]; | |
| - (void) firstNameChanged:(id)firstName { | |
| NSLog(@"changed: %@", firstName); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # | |
| # python drive.py "origin" ["waypoint" ... ] "destination" | |
| # | |
| # i.e. python drive.py "Union Square, San Francisco" "Ferry Building, San Francisco" 'Bay Bridge' SFO | |
| import sys, json, urllib2, md5, os.path, pprint | |
| from math import radians, sin, cos, atan2, pow, sqrt | |
| from urllib import quote_plus | |
| from xml.sax.saxutils import escape | |
| from optparse import OptionParser |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # ssh-multi | |
| # D.Kovalov | |
| # Based on http://linuxpixies.blogspot.jp/2011/06/tmux-copy-mode-and-how-to-control.html | |
| # a script to ssh multiple servers over multiple tmux panes | |
| starttmux() { | |
| if [ -z "$HOSTS" ]; then |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #import <pthread.h> | |
| #import <mach/thread_act.h> | |
| // These two functions are declared in mach/thread_policy.h, but are commented out. | |
| // They are documented here: https://developer.apple.com/library/mac/#releasenotes/Performance/RN-AffinityAPI/_index.html | |
| kern_return_t thread_policy_set( | |
| thread_t thread, | |
| thread_policy_flavor_t flavor, | |
| thread_policy_t policy_info, | |
| mach_msg_type_number_t count); |
OlderNewer