Skip to content

Instantly share code, notes, and snippets.

View linkesch's full-sized avatar

Pavel Linkesch linkesch

View GitHub Profile
@linkesch
linkesch / gist:6972733
Last active December 25, 2015 11:59
git - Ignore changes in a certain file
git update-index --assume-unchanged <file>
git update-index --no-assume-unchanged <file>
git ls-files -v|grep '^h'
@linkesch
linkesch / gist:6990564
Created October 15, 2013 12:08
MongoDB - find duplicates
db.items.aggregate(
{ $group : {_id : "$fieldName", total : { $sum : 1 } } },
$match : { total : { $gte : 2 } } },
$sort : {total : -1} },
$limit : 5 }
);
@linkesch
linkesch / gist:7115200
Last active December 26, 2015 07:29
Cocoa - notifications with OS X Notification Center - http://stackoverflow.com/a/11815544/291500
- (IBAction)showNotification:(id)sender{
NSUserNotification *notification = [[NSUserNotification alloc] init];
notification.title = @"Hello, World!";
notification.informativeText = @"A notification";
notification.soundName = NSUserNotificationDefaultSoundName;
[[NSUserNotificationCenter defaultUserNotificationCenter] deliverNotification:notification];
}
@linkesch
linkesch / gist:7219704
Created October 29, 2013 18:08
Run instanbul with mocha
istanbul cover _mocha -- -R spec
@linkesch
linkesch / gist:88be2badb1175e879986
Created October 23, 2014 16:25
List of repo contributors
git shortlog -s | sort -nr
@linkesch
linkesch / gist:74a0f6640b11c99c04c9
Created January 19, 2015 14:36
Batch image resize on Mac OS X
sips -Z 640 *.jpg
@linkesch
linkesch / gist:262a3589a26997b2657d
Created March 26, 2015 10:48
Batch convert image format on Mac OS X
mkdir converted; for i in *.jpg; do sips -s format png $i --out converted/$i.png; done
@linkesch
linkesch / Vagrantfile
Last active August 29, 2015 14:27
Fix Vagrant "Warning: Authentication failure. Retrying..."
# Fix Vagrant "Warning: Authentication failure. Retrying..." error
# Add this line to your Vagrant file
# https://github.com/mitchellh/vagrant/issues/5186
config.ssh.insert_key = false
@linkesch
linkesch / gist:d8ee1828b55c253cb520
Last active October 14, 2015 08:25
Delete local and remote GIT branch
# Delete local branch
git branch -D <branch>
# Delete remote branch
git push origin --delete <branch>
@linkesch
linkesch / .sh
Created December 17, 2015 10:45
Update remote branches on local machine
# http://kb.detlus.com/articles/git/how-to-update-remote-branch-list-on-local-machine/
git remote update origin --prune