Skip to content

Instantly share code, notes, and snippets.

- (void)viewDidLoad
{
[super viewDidLoad];
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(keyboardWillShow:)
name:UIKeyboardWillShowNotification
object:nil];
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(keyboardWillHide:)
@keicoder
keicoder / gist:9181595
Last active August 29, 2015 13:56 — forked from troyharris/gist:6877536
objective-c : UITextView - A very hacky way to enable UITextView to scroll to the cursor when typing. I believe I got this from someone on SO but I can't find the original source anymore
- (void)textViewDidChange:(UITextView *)textView {
[self _showTextViewCaretPosition:textView];
}
- (void)textViewDidChangeSelection:(UITextView *)textView {
[self _showTextViewCaretPosition:textView];
}
- (void)_showTextViewCaretPosition:(UITextView *)textView {
@keicoder
keicoder / index.html
Created December 18, 2013 16:46 — forked from pheXion/index.html
HTML: Base Bootstrap
<!doctype html>
<html>
<head>
<meta charset="utf-8" />
<meta name="description" content="A description about your site" />
<meta name="keywords" content="keywords, separated, by, comma" />
<meta name="author" content="pheXion.com" />
<title>Untitled Document</title>
<link rel="shortcut icon" href="favicon.ico" />
@keicoder
keicoder / handy-regexes.txt
Created December 18, 2013 16:41 — forked from rotexdegba/handy-regexes.txt
regex : Remove spaces after last semi colon on each line, Remove spaces on blank lines
Remove spaces after last semi colon on each line of a php file.
find:
;[^\S\n]+$
relace with:
;
---------------------------------------------------------------------------------------
Remove spaces on blank lines
find:
^[^\S]+$
replace with: