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
// OSX | |
open -na Google\ Chrome --args --disable-web-security --user-data-dir="/tmp/chrome_dev" |
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
/* | |
How to use: | |
<input type="text" data-bind="bsSlider: { value: distance, min: 1, max: 100, step: 5 }"/> | |
Options can be removed or overriden. | |
*/ | |
ko.bindingHandlers.bsSlider = { | |
init: function (element, valueAccessor, allBindings, viewModel, bindingContext) { | |
var options = ko.unwrap(valueAccessor()); |
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
import Foundation | |
extension UIImage { | |
func fixOrientation() -> UIImage { | |
let width = CGImageGetWidth(self.CGImage) | |
let height = CGImageGetHeight(self.CGImage) | |
var transform = CGAffineTransformIdentity | |
var bounds = CGRect(x:0, y:0, width:width, height:height) | |
let scaleRatio = bounds.size.width / CGFloat(width) |
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
// Requires BlockUI | |
ko.bindingHandlers.blockUI = { | |
update: function (element, valueAccessor, allBindings, viewModel, bindingContext) { | |
var isEnabled = ko.unwrap(valueAccessor()) || false; | |
if (isEnabled) { | |
$(element).block(); | |
} | |
else { | |
$(element).unblock(); | |
} |