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
// | |
// 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 |
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
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 |
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
@implementation UIImage (Arrow) | |
+ (UIImage*)arrowImageWithSize:(CGFloat)arrowSize withColor:(UIColor*)arrowColor thickness:(CGFloat)thickness | |
{ | |
// | |
// Create bezier path for arrow | |
// | |
// +---+-------+-+ | |
// | | | |
// | + |
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
/* | |
* Bootstrap 2.3.2 carousel performance patch | |
* `transform: translate()` significantly improves animation smoothness | |
**/ | |
.carousel-inner > .item { | |
-webkit-transition: -webkit-transform 0.6s ease-in-out; | |
-moz-transition: -moz-transform 0.6s ease-in-out; | |
-ms-transition: -ms-transform 0.6s ease-in-out; | |
-o-transition: -o-transform 0.6s ease-in-out; |
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
// | |
// 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({ |
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
// | |
// 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; |
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
// 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++) |
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
// 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 |
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
// | |
// main.m | |
// | |
#import <UIKit/UIKit.h> | |
#import <pop/POP.h> | |
#import "AppDelegate.h" | |
static CGFloat deceleration_for_distance(CGFloat distance, CGFloat velocity) | |
{ |
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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8"> | |
<title>JS Bin</title> | |
<script src="https://raw.githubusercontent.com/konvajs/konva/master/konva.min.js"></script> | |
</head> | |
<body> | |
<label><input type="checkbox" value="yes" id="disableHitFromCache" /> Disable drawHitFromCache</label> | |
<div id="konva" style="width: 300px; height: 300px;"></div> |
OlderNewer