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
# get pdftk from here: https://www.pdflabs.com/tools/pdftk-the-pdf-toolkit/pdftk_server-2.02-mac_osx-10.6-setup.pkg | |
pdftk dashboard_UX_v3.graffle.pdf burst | |
# sips is built in to OSX | |
ls *.pdf | xargs -I '{}' sips -s format png '{}' --out '{}'.png |
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
extension NSTimer { | |
/** | |
Creates and schedules a one-time `NSTimer` instance. | |
- Parameters: | |
- delay: The delay before execution. | |
- handler: A closure to execute after `delay`. | |
- Returns: The newly-created `NSTimer` instance. | |
*/ |
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
- (void)reconfigureVisibleCells | |
{ | |
NSInteger sectionCount = [self numberOfSectionsInTableView:self.tableView]; | |
for (NSInteger section = 0; section < sectionCount; ++section) { | |
NSInteger rowCount = [self tableView:self.tableView numberOfRowsInSection:section]; | |
for (NSInteger row = 0; row < rowCount; ++row) { | |
NSIndexPath *indexPath = [NSIndexPath indexPathForRow:row inSection:section]; | |
UITableViewCell *cell = [self.tableView cellForRowAtIndexPath:indexPath]; |
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
# tmux-mouse-toggle | |
# via http://qiita.com/kawaz/items/7b15e18ca8e072c1dc57 | |
if [[ -n $TMUX ]]; then | |
if [[ -z "$(tmux show-options -gw mode-mouse | grep off)" ]]; then | |
tmux set-option -gq mouse-utf8 off | |
tmux set-option -gq mouse-resize-pane off | |
tmux set-option -gq mouse-select-pane off | |
tmux set-option -gq mouse-select-window off | |
tmux set-window-option -gq mode-mouse off |
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
#define NSNullObjects @[@"",@0,@{},@[]] | |
@interface NSNull (InternalNullExtention) | |
@end | |
@implementation NSNull (InternalNullExtention) | |
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
/** | |
* Solution for http://stackoverflow.com/questions/21786375/ios-7-hover-click-issue-no-click-triggered-in-some-cases | |
*/ | |
$(document).ready(function(){ | |
if (/* if this is not iOS */) { | |
return; | |
} | |
var $body = $('body'); |
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 | |
# gdbGetStrippedSymbols.sh | |
# @author Dominik Hadl (@dominikhadl) | |
# @description This script automates the setup of gdb on a stripped applicaiton adds symbols. It uses objc-symbols to get the symbols, | |
# then SymTabCreator and finally creates a command that is automatically loaded into gdb on start. | |
# @license Licensed under WTFPL license (see http://www.wtfpl.net/txt/copying/ for full license). | |
# @dependencies | |
# 1. objc-symbols | |
# 2. SymTabCreator | |
# 3. gdb (really non-obvious) |
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
sudo find /private/var/folders/ -name com.apple.dock.iconcache -exec rm {} \; |
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
class TreeNode{ | |
int val; | |
TreeNode left, right; | |
TreeNode(int val){ | |
this.val = val; | |
} | |
} | |
public String serialize(TreeNode root){ | |
StringBuilder sb = new StringBuilder(); |
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
" Search Dash for word under cursor | |
function! SearchDash() | |
let s:browser = "/usr/bin/open" | |
let s:wordUnderCursor = expand("<cword>") | |
let s:url = "dash://".s:wordUnderCursor | |
let s:cmd ="silent ! " . s:browser . " " . s:url | |
execute s:cmd | |
redraw! | |
endfunction | |
map <leader>d :call SearchDash()<CR> |
NewerOlder