Skip to content

Instantly share code, notes, and snippets.

@ipodishima
ipodishima / gist:3188708
Created July 27, 2012 15:34
Remove Shadow on web view
// From http://stackoverflow.com/questions/1074320/remove-uiwebview-shadow
- (void) removeShadowForWebView:(UIWebView*)webV
{
// remove the shadow
if ([[webV subviews] count] > 0)
{
for (UIView* shadowView in [[[webV subviews] objectAtIndex:0] subviews])
{
if ([shadowView isKindOfClass:[UIImageView class]]) {
[shadowView setHidden:YES];
/*
* Finder.h
*/
#import <AppKit/AppKit.h>
#import <ScriptingBridge/ScriptingBridge.h>
@class FinderApplication, FinderItem, FinderContainer, FinderComputerObject, FinderDisk, FinderFolder, FinderDesktopObject, FinderTrashObject, FinderFile, FinderAliasFile, FinderApplicationFile, FinderDocumentFile, FinderInternetLocationFile, FinderClipping, FinderPackage, FinderWindow, FinderFinderWindow, FinderDesktopWindow, FinderInformationWindow, FinderPreferencesWindow, FinderClippingWindow, FinderProcess, FinderApplicationProcess, FinderDeskAccessoryProcess, FinderPreferences, FinderLabel, FinderIconFamily, FinderIconViewOptions, FinderColumnViewOptions, FinderListViewOptions, FinderColumn, FinderAliasList;
@tburch
tburch / FizzBuzz.scala
Created July 27, 2012 16:31
FizzBuzz
(1 to 100) map { x =>
(x % 3, x % 5) match {
case (0, 0) => ”FizzBuzz”
case (0, _) => “Fizz”
case (_, 0) => “Buzz”
case _ => x.toString
}
} foreach println
@sspencer
sspencer / FormatThousandsSeparator.m
Created July 27, 2012 19:18
Format Decimal Number with Thousands Separator
NSNumberFormatter *formatter = [[NSNumberFormatter alloc] init];
[formatter setNumberStyle:NSNumberFormatterDecimalStyle];
NSLog(@"formatted: %@", [formatter stringFromNumber:[NSNumber numberWithInt:1234567]]);
@iamjpg
iamjpg / gist:3194394
Created July 28, 2012 18:48
The Iron by Henry Rollins
This article originally appeared in Details Magazine some time around 1994 or 1995, I believe. This is a great essay by Henry Rollins on the benefits and lessons of lifting weights.
=================================================
I believe that the definition of definition is reinvention. To not be like your parents. To not be like your friends. To be yourself.
Completely.
When I was young I had no sense of myself. All I was, was a product of all the fear and humiliation I suffered. Fear of my parents. The humiliation of teachers calling me "garbage can" and telling me I'd be mowing lawns for a living. And the very real terror of my fellow students. I was threatened and beaten up for the color of my skin and my size. I was skinny and clumsy, and when others would tease me I didn't run home crying, wondering why.
@wohckcin
wohckcin / mountain-lion-brew-setup.markdown
Created July 29, 2012 15:11 — forked from myobie/mountain-lion-brew-setup.markdown
Get Mountain Lion and Homebrew to Be Happy

Get Mountain Lion and Homebrew to Be Happy

1) Install XCode 4.4 into /Applications

Get it from http://developer.apple.com. You will not be able to submit apps to any stores using this XCode version, so turn away if that is something you might want to do.

2) Install Command Line Tools

In XCode's Preferences > Downloads you can install command line tools.

@mikeabdullah
mikeabdullah / gist:3200382
Created July 29, 2012 17:22
Power assertion example
// Begin the power assertion
IOPMAssertionID assertionID;
IOReturn asserted = IOPMAssertionCreateWithName(kIOPMAssertionTypeNoIdleSleep,
kIOPMAssertionLevelOn,
CFSTR("Sandvox Publishing"),
&assertionID);
if (asserted != kIOReturnSuccess) // handle the error; log it or something
// Do your long-running work
@harperreed
harperreed / peter-thiels-cs183-startup-class-01-notes-essay.md
Created July 29, 2012 21:20
Notes Essays—Peter Thiel’s CS183: Startup—Stanford, Spring 2012

Here is an essay version of my class notes from Class 1 of CS183: Startup. Errors and omissions are my own. Credit for good stuff is Peter’s entirely.

CS183: Startup—Notes Essay—The Challenge of the Future

Purpose and Preamble

@jwilling
jwilling / JWLocationManager.h
Created July 31, 2012 20:02
Block-based wrapper around Core Location
#import <Foundation/Foundation.h>
#import <CoreLocation/CoreLocation.h>
typedef void (^JWLocationManagerCallback)(CLLocation *location);
typedef void (^JWLocationManagerErrorCallback)(NSError *error);
@interface JWLocationManager : NSObject <CLLocationManagerDelegate>
@property (nonatomic, copy) NSString *purpose;
@property (nonatomic, copy) JWLocationManagerCallback locationUpdatedBlock;
@aaronjensen
aaronjensen / gist:3220780
Created July 31, 2012 21:34
tmux agenda
* What is tmux?
* Why tmux?
* tmux vs screen: http://www.wikivs.com/wiki/Screen_vs_tmux
* Install tmux
* brew install tmux
* tmux basics
* leader key (default sucks)
* sessions
* windows
* panes