Skip to content

Instantly share code, notes, and snippets.

View fcy's full-sized avatar

Felipe Cypriano fcy

View GitHub Profile
@matthewmccullough
matthewmccullough / gist:47267
Created January 15, 2009 05:15 — forked from halbtuerke/gist:31934
Show Git dirty status in your Unix bash prompt (symbols not compatible with CygWin)
RED="\[\033[0;31m\]"
YELLOW="\[\033[0;33m\]"
GREEN="\[\033[0;32m\]"
BLUE="\[\033[0;34m\]"
LIGHT_RED="\[\033[1;31m\]"
LIGHT_GREEN="\[\033[1;32m\]"
WHITE="\[\033[1;37m\]"
LIGHT_GRAY="\[\033[0;37m\]"
COLOR_NONE="\[\e[0m\]"
@matthewmccullough
matthewmccullough / O'Reilly-Fringes-Of-Git-Webinar.markdown
Created April 13, 2011 23:24
Matthew McCullough & Tim Berglund's O'Reilly "Fringes Of Git" Webinar Source

O'Reilly Git Webinar

The Fringes of Git

Overview

Matthew McCullough and Tim Berglund, authors of the O'Reilly Git Master Class videos will introduce you to the very edges of Git's capabilities. There are plenty of "Getting Started with Git" sessions on the web, but we'd like to take 40 minutes of your time in an entirely different direction. These 40 minutes will primarily be live coding with a few diagrams for reference. We'll show you how Git reaches farther than any other version control system to provide capabilities for both the novice and the master craftsperson.

Webinar Outline

Rebasing

@boctor
boctor / BaseViewController.m
Created May 5, 2011 02:08
A base view controller class that when running on the simulator in debug mode, will auto simulate a memory warning every time the view controller's viewDidAppear is called
//
// BaseViewController.m
//
// Created by Peter Boctor on 5/4/11.
//
// Copyright (c) 2011 Peter Boctor
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
@mbinna
mbinna / UIViewController+MBSensitiveInformationInScreenshotPrevention.h
Created June 12, 2011 13:00
Prevent sensitive information from appearing in the screenshot that is automatically taken when the application transitions from the foreground to the background and vice-versa.
//
// UIViewController+MBSensitiveInformationInScreenshotPrevention.h
//
// Created by Manuel Binna on 05.05.11.
// Copyright 2011 Manuel Binna. All rights reserved.
//
@interface UIViewController (MBSensitiveInformationInScreenshotPrevention)
@nfarina
nfarina / NSDate+Drawing.h
Created November 17, 2011 15:49
Useful functions for drawing NSDate in the exact style of Apple's iOS Mail app.
/*
The MIT License
Copyright (c) 2010 Nick Farina
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
@iamleeg
iamleeg / README.md
Created February 3, 2012 18:16
Causing methods generated by AppCode to throw exceptions

Go to "File Templates" in the Preferences window, then under the 'code' tab choose "OC implemented method body" and paste the template method in there. This then causes AppCode to generate methods like this:

- (NSApplicationTerminateReply)applicationShouldTerminate:(NSApplication *)sender {
    [[NSException exceptionWithName:NSInternalInconsistencyException reason:@"Unimplemented method" userInfo:nil] raise];
    return 0;
    //To change the template use AppCode | Preferences | File Templates.
    
}

Another approach would be to use the usual forwarding approach by putting this as the first line:

@rafaelp
rafaelp / gist:1976687
Created March 5, 2012 04:55
A solution to a more obscure problem related to the "vulnerability" of mass assignment:
# account.rb
class Account < ActiveRecord::Base
has_many :users
has_many :services
end
# user.rb
class User < ActiveRecord::Base
belongs_to :account
end
@imathis
imathis / tweetbot-mute-regex.md
Created June 27, 2012 19:45
Tweetbot can use regular expressions to mute tweets in your timeline and mentions.

Hashtag abuse

Three or more hashtags.

#[^#]+#[^#]+#

Long hashtags (15+ characters): #hashtagpunchline

anonymous
anonymous / gist:3430707
Created August 22, 2012 23:57
Pragmatic Thinking and Learning: Refactor Your Wetware

When you are not very skilled in some area, you are more likely to think you’re actually pretty expert at it.

In the paper “Unskilled and Unaware of It: How Difficulties in Recognizing One’s Own Incompetence Lead to Inflated Self-Assessments” [AUOIHDIROOILTIS] , psychologists Kruger and Dunning relate the unfortunate story of a would-be thief who robbed a bank in broad daylight. He was incredulous at his prompt arrest, because he was under the impression that wearing lemon juice on your face would make you invisible to security cameras.

The “lemon juice man” never suspected that his hypothesis was, er, suspect. This lack of accurate self-assessment is referred to as second-order incompetence, that is, the condition of being unskilled and unaware of it.

This condition is a huge problem in software development, because many programmers and managers aren’t aware that better methods and practices even exist. I’ve met many younger programmers (one to five years of experience) who never have been on a successful

@d0k
d0k / gist:3608547
Last active February 21, 2022 23:34
clang warning flags
-W
-Wextra
-Wmissing-field-initializers
-Wignored-qualifiers
-Winitializer-overrides
-Wsemicolon-before-method-body
-Wmissing-method-return-type
-Wsign-compare
-Wunused-parameter
-W#pragma-messages