Skip to content

Instantly share code, notes, and snippets.

View pronebird's full-sized avatar

Andrej Mihajlov pronebird

View GitHub Profile
@pronebird
pronebird / mercurial-homebrew.log
Created October 18, 2012 12:23
Homebrew mercurial problem
pronebird:homejs pronebird$ brew doctor
Warning: Some directories in /usr/local/share/man aren't writable.
This can happen if you "sudo make install" software that isn't managed
by Homebrew. If a brew tries to add locale information to one of these
directories, then the install will fail during the link step.
You should probably `chown` them:
/usr/local/share/man/manm
Warning: Setting DYLD_LIBRARY_PATH can break dynamic linking.
You should probably unset it.
➜ homejs brew install mercurial -v > log.log
brew: superenv removed: -g -Os -Wall -Wstrict-prototypes -Wshorten-64-to-32 -g -Os -Wall -Wstrict-prototypes
brew: superenv removed: -g -Os -Wall -Wstrict-prototypes -Wshorten-64-to-32 -g -Os -Wall -Wstrict-prototypes
brew: superenv removed: -g -Os -Wall -Wstrict-prototypes -Wshorten-64-to-32 -g -Os -Wall -Wstrict-prototypes
brew: superenv removed: -g -Os -Wall -Wstrict-prototypes -Wshorten-64-to-32 -g -Os -Wall -Wstrict-prototypes
brew: superenv removed: -g -Os -Wall -Wstrict-prototypes -Wshorten-64-to-32 -g -Os -Wall -Wstrict-prototypes
brew: superenv removed: -g -Os -Wall -Wstrict-prototypes -Wshorten-64-to-32 -g -Os -Wall -Wstrict-prototypes
brew: superenv removed: -g -Os -Wall -Wstrict-prototypes -Wshorten-64-to-32 -g -Os -Wall -Wstrict-prototypes
warning: hgbuildmo: could not find msgfmt executable, no translations will be built
@pronebird
pronebird / UISearchBarInTableHeaderBackgroundColorFix.m
Last active August 29, 2015 14:01
Background color fix for stub view positioned between table view top edge and UISearchBar as header view
//
// Fix background color bug
// This patch can be applied once in viewDidLoad if you use UITableViewController
// http://stackoverflow.com/q/23026531/351305
//
- (void)_fixSearchBarHeaderViewBackgroundColorBug {
// First subview in UITableView is a stub view positioned between table's top edge and table's header view.
UIView* stubView = [self.tableView.subviews firstObject];
// Make sure it's stub view and not anything else
On branch master
Changes not staged for commit:
(use "git add/rm <file>..." to update what will be committed)
(use "git checkout -- <file>..." to discard changes in working directory)
deleted: Library/Aliases/hugs
deleted: Library/Aliases/saga
modified: Library/Contributions/brew_bash_completion.sh
modified: Library/Contributions/brew_fish_completion.fish
modified: Library/Contributions/brew_zsh_completion.zsh
@pronebird
pronebird / gist:c3dde8c25938c35c1ab8
Last active August 29, 2015 14:05
Draw arrow with rounded corners using CoreGraphics
@implementation UIImage (Arrow)
+ (UIImage*)arrowImageWithSize:(CGFloat)arrowSize withColor:(UIColor*)arrowColor thickness:(CGFloat)thickness
{
//
// Create bezier path for arrow
//
// +---+-------+-+
// | |
// | +
@pronebird
pronebird / carousel.css
Last active August 29, 2015 14:07
Bootstrap 2.3.2 carousel performance patch
@pronebird
pronebird / mobile-safari-addressbar-help-tip.js
Created October 27, 2014 14:32
Show a help tip how to hide navigation bars on Mobile Safari when in landscape
//
// A helper function to toggle a help tip
// about how to hide Safari address bar when it's visible
// Monitors only landscape mode and works on Safari on iOS 8+
//
// This is a part of my post on Coderwall: https://coderwall.com/p/yaro4w
//
var attachMobileSafariAddressBarHelpTip = function (target) {
var $target = $(target);
$target.tooltip({
@pronebird
pronebird / ios-screenlock-detector.js
Last active August 29, 2015 14:08
iOS 8 standalone apps screen lock detector
//
// Detect screenlock on standalone ios apps and replace content with message to reload the app
// When user locks screen on iOS 8 devices, everything dies except web workers
// This will definitely drain battery.
// Based on the idea by ajayel: http://stackoverflow.com/a/26091749/351305
//
(function () {
var WORKER_URI = '/app/worker.js';
var TIMEOUT = 2000;
@pronebird
pronebird / js.js
Created November 7, 2014 21:57
js2coffee test JS for "for" loops
// if statements
for(var i = 0; i < 5; i++) {
if(i == 0) {
continue; // if body
}
else if(i == 1) continue; // inline else+if
else continue; // inline else
for(var j = 0; j < 2; j++)
for(var k = 0; k < 4; k++)
@pronebird
pronebird / Example.m
Last active August 29, 2015 14:16
JDStatusBarNotification+Queue category
// Create statusbar activity per upload
JDStatusBarActivity* upload1 = [JDStatusBarActivity new];
upload1.styleName = JDStatusBarStyleDark;
upload1.message = @"Uploading file #1";
JDStatusBarActivity* upload2 = [JDStatusBarActivity new];
upload2.styleName = JDStatusBarStyleDark;
upload2.message = @"Uploading file #2";
// Add activities to status bar