-
"ibm850"
-
"ASCII"
-
"UTF-8"
-
"X-ISO-10646-UCS-4-3412"
-
"X-ISO-10646-UCS-4-2143"
This file contains 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
/* NSView to PNG */ | |
NSView *view = versionsButton; /* this is the view :) */ | |
NSBitmapImageRep *rep = [view bitmapImageRepForCachingDisplayInRect:[view bounds]]; | |
[view cacheDisplayInRect:[view bounds] toBitmapImageRep:rep]; | |
NSData *data = [rep representationUsingType:NSPNGFileType properties:nil]; | |
[data writeToFile:@"/path/to/the/a/nice/place/view.png" atomically:YES]; |
This file contains 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 | |
INFILE=$1 | |
ZIP=".zip" | |
OUTFILE=$INFILE$ZIP | |
if [ -f "$INFILE" ]; then | |
echo "Compressing file: $INFILE" | |
COUNTER=0 | |
while [ -f $OUTFILE ]; |
This file contains 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 | |
# configuration | |
#host1 is for metadata, host2 is for data | |
host1="api.dropbox.com" | |
host2="api-content.dropbox.com" | |
# usage | |
if [ "$*" == "" ]; then | |
echo "usage: $0 [restore|off|fast|medium|slow]" |
This file contains 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
<!DOCTYPE HTML> | |
<html> | |
<head> | |
<style> | |
body { | |
margin: 0px; | |
padding: 0px; | |
} | |
#myCanvas { | |
border: 1px solid #9C9898; |
This file contains 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
// Created by Guillermo Enriquez on 09/10/2012. | |
// Copyright 2012 nacho4d. All rights reserved. | |
int main(int argc, char *argv[]) { | |
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; | |
int retVal = UIApplicationMain(argc, argv, @"Application", @"AppDelegate"); | |
[pool drain]; | |
return retVal; | |
} |
This file contains 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
// Adds a drop shadow to the view | |
#import <QuartzCore/QuartzCore.h> | |
@interface UIView (WMAdditions) | |
- (void)addDropShadow; | |
@end | |
@implementation UIView (Dropshadow) | |
- (void)addDropShadow |
This file contains 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 <Foundation/Foundation.h> | |
void doTaskAndCapture(void); | |
void doTaskAndCapture() | |
{ | |
@try | |
{ | |
// Set up the process | |
NSTask *t = [[[NSTask alloc] init] autorelease]; | |
[t setLaunchPath:@"/bin/ls"]; |
This file contains 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 <Foundation/Foundation.h> | |
#import <CoreFoundation/CoreFoundation.h> | |
# pragma mark Daemon Protocol | |
@protocol DaemonProtocol | |
- (void)performWork; | |
@end | |
# pragma mark MyTask Object Conforms to Protocol |
This file contains 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
on replace(src, tg, rp) | |
set oldDel to AppleScript's text item delimiters | |
set AppleScript's text item delimiters to tg | |
set myList to text items of src | |
set AppleScript's text item delimiters to rp | |
set myText to myList as string | |
set AppleScript's text item delimiters to oldDel | |
return myText | |
end replace |
OlderNewer