git clone --recursive <repo> <the-name-you-want-for-repo-directory>
git remote add production <production-repo-url>
git add . -A
git commit -am 'message'
git pull -r origin master
I do not claim to be smart at all, but I've worked with very smart people and they have taught me about git and how it works at a fundamental level, so I feel at this point qualified to offer some of the stuff I've learned as best practices. So her'goes.
When you pull, you sometimes don't know what you're pulling. It can be helpful to use git fetch --all
and compare what's on your remotes with git diff origin/master
to see what's different.
more to come…
In sublime 3, the new command for exiting_insert_mode
(for Vintageous used in Sublime Text 3 vs Vintage used in 2) is
vi_enter_normal_mode
Create a plugin:
import sublime, sublime_plugin
class ExitAutoCompleteAndInsertModeCommand(sublime_plugin.TextCommand):
def run(self, edit):
self.view.run_command("hide_auto_complete")
You've got files in a git repo and you want them on a static server. Here's how it's done using a Mac Mini:
Set up your local repo
$ mkdir marketing && cd marketing
$ git init
$ echo 'Hello, world!' > index.html
$ git add .
$ git commit -am "init"
- (void)drawInRect:(NSRect)dstRect fromRect:(NSRect)srcRect operation:(NSCompositingOperation)op fraction:(CGFloat)alpha { | |
[self drawInRect:dstRect fromRect:srcRect operation:op fraction:alpha respectFlipped:YES hints:nil]; | |
} | |
- (void)drawInRect:(NSRect)dstRect fromRect:(NSRect)srcRect operation:(NSCompositingOperation)op fraction:(CGFloat)alpha respectFlipped:(BOOL)respectFlipped hints:(NSDictionary *)hints { | |
CGImageRef image = [self CGImageForProposedRect:&dstRect context:[NSGraphicsContext currentContext] hints:hints]; | |
if (image == NULL) { | |
NSLog(@"*** Could not get CGImage of %@", self); | |
return; | |
} |
Some developers still don’t know you should paste “Iñtërnâtiônàlizætiøn” everywhere while testing,
Sometimes, a view will appear on your screen and you don't know how it got there. Did your app add it? Did the SDK add it? Here's how to get the debugger to stop right where it was added so you can look at the call stack.
First, set up a symbolic breakpoint on [UIView addSubview:]
// Create hidden image since we can't hide/set nil the image for the search field | |
UIGraphicsBeginImageContext(self.frame.size); | |
CGContextRef context = UIGraphicsGetCurrentContext(); | |
CGContextSetFillColorWithColor(context, [[UIColor clearColor] CGColor]); | |
CGContextFillRect(context, CGRectMake(0, 0, self.frame.size.width, self.frame.size.height)); | |
UIImage *blankImage = UIGraphicsGetImageFromCurrentImageContext(); | |
UIGraphicsEndImageContext(); |