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
#vim ~/.subversion/config | |
global-ignores = *.o *.lo *.la *.al .libs *.so *.so.[0-9]* *.a *.pyc *.pyo | |
*.rej *~ #*# .#* .*.swp .DS_Store *.xcuserdatad |
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
//1 Creating a New Managed Object Context | |
//To create a new managed object context, you need a persistent store coordinator. | |
NSPersistentStoreCoordinator *psc = <#Get the coordinator#>; | |
NSManagedObjectContext *newContext = [[NSManagedObjectContext alloc] init]; | |
[newContext setPersistentStoreCoordinator:psc]; | |
//using the same coordinator as the existing one | |
NSManagedObjectContext *context = <#Get the context#>; | |
NSPersistentStoreCoordinator *psc = [context persistentStoreCoordinator]; | |
NSManagedObjectContext *newContext = [[NSManagedObjectContext alloc] init]; |
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
memcached -d -l 127.0.0.1 -p 11211 -m 64 |
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
- (void)viewDidLoad | |
{ | |
[super viewDidLoad]; | |
CGRect frame = self.view.bounds; | |
for (NSInteger i=0; i<10; i++) { | |
CGFloat left = (frame.size.width-100)/2+i%2*10; | |
CGFloat top = (frame.size.height-100)/2+i%3*10; | |
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
CGContextRef context = UIGraphicsGetCurrentContext(); | |
// Flip the coordinate system | |
// Make an attributed string | |
NSAttributedString *attributedString = [[NSAttributedString alloc] initWithString:@"Hello CoreText!"]; | |
CFAttributedStringRef attributedStringRef = (CFAttributedStringRef)attributedString; | |
// Simple CoreText with CTFrameDraw | |
CTFramesetterRef framesetter = CTFramesetterCreateWithAttributedString(attributedStringRef); |
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
CGContextRef context = UIGraphicsGetCurrentContext(); | |
// Flip the coordinate system | |
CGContextSetTextMatrix(context, CGAffineTransformIdentity); | |
CGContextTranslateCTM(context, 0, self.bounds.size.height); | |
CGContextScaleCTM(context, 1.0, -1.0); | |
NSDictionary *attrs = @{NSFontAttributeName: [UIFont systemFontOfSize:20], | |
NSForegroundColorAttributeName: [UIColor blueColor], | |
NSUnderlineStyleAttributeName: @(NSUnderlineStyleSingle), |
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
CGContextRef context = UIGraphicsGetCurrentContext(); | |
// // Flip the coordinate system | |
// CGContextSetTextMatrix(context, CGAffineTransformIdentity); | |
// CGContextTranslateCTM(context, 0, self.bounds.size.height); | |
// CGContextScaleCTM(context, 1.0, -1.0); | |
UIFont *customFont = [UIFont systemFontOfSize:20]; | |
CTFontRef font = CTFontCreateWithName((CFStringRef)customFont.fontName, 20, NULL); |
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
export PATH="/Applications/Xcode6-Beta.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Applications/Xcode6-Beta.app/Contents/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin" | |
/Applications/Xcode6-Beta.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/swift hello.swift | |
clang world.c -oworld |
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
// | |
// DLMultiSelectionControl.h | |
// DLMultiSelectionControl | |
// | |
// Created by Darcy Liu on 8/31/14. | |
// Copyright (c) 2014 Close To U. All rights reserved. | |
// | |
#import <UIKit/UIKit.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
# BEGIN GZIP | |
# http://httpd.apache.org/docs/2.2/mod/mod_deflate.html | |
<IfModule mod_deflate.c> | |
# Enabling Compression | |
SetOutputFilter DEFLATE | |
# Insert filters | |
AddOutputFilterByType DEFLATE text/plain | |
AddOutputFilterByType DEFLATE text/html | |
AddOutputFilterByType DEFLATE text/xml | |
AddOutputFilterByType DEFLATE text/css |