This file contains hidden or 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
// NWURLConnection - an NSURLConnectionDelegate based on blocks with cancel. | |
// Similar to the `sendAsynchronousRequest:` method of NSURLConnection, but | |
// with `cancel` method. Requires ARC on iOS 6 or Mac OS X 10.8. | |
// License: BSD | |
// Author: Leonard van Driel, 2012 | |
@interface NWURLConnection : NSObject<NSURLConnectionDelegate> | |
@property (nonatomic, strong) NSURLRequest *request; | |
@property (nonatomic, strong) NSOperationQueue *queue; |
This file contains hidden or 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
######################### | |
# .gitignore file for Xcode4 and Xcode5 Source projects | |
# | |
# Apple bugs, waiting for Apple to fix/respond: | |
# | |
# 15564624 - what does the xccheckout file in Xcode5 do? Where's the documentation? | |
# | |
# Version 2.6 | |
# For latest version, see: http://stackoverflow.com/questions/49478/git-ignore-file-for-xcode-projects | |
# |
This file contains hidden or 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
############################################################################### | |
# The MIT License | |
# | |
# Copyright 2012-2014 Jakub Jirutka <[email protected]>. | |
# | |
# Permission is hereby granted, free of charge, to any person obtaining a copy | |
# of this software and associated documentation files (the "Software"), to deal | |
# in the Software without restriction, including without limitation the rights | |
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
# copies of the Software, and to permit persons to whom the Software is |
This file contains hidden or 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
var ParentClass = function() { } | |
ParentClass.prototype = {} | |
ParentClass.prototype.constructor = ParentClass; | |
var SubClass = function() { | |
ParentClass.prototype.constructor.apply(this, []); | |
}; | |
SubClass.prototype = Object.create(ParentClass.prototype) | |
SubClass.prototype.constructor = SubClass |
This file contains hidden or 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> | |
<meta charset=utf-8> | |
<meta name=viewport content="width=device-width, initial-scale=1, maximum-scale=1"> | |
<meta name=apple-mobile-web-app-capable content=yes> | |
<meta name=apple-mobile-web-app-status-bar-style content=black> | |
<title>Test fullscreen</title> | |
<style> | |
html, body { | |
margin: 0; | |
padding: 0; |
This file contains hidden or 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
/* | |
# Deflate compression using Canvas 2d API | |
Canvas API provides HTMLCanvasElement#toDataURL, which allows serialize canvas image to png image. I do not know about result png format (how many bits per pixel and there is alpha channel or not, may be palette or grayscale image). WHATWG spec also do not points this ie its UA dependent. Anyway basic rules: | |
+ browsers do not supports images with width or height > 20 000 px => we use square image instead linear(1*X or X*1) | |
+ if alpha component of canvas data eq 0 => browser reset red, green, blue to 0 too even if globalCompositeOperation = 'copy' | |
+ even if globalCompositeOperation = 'copy', globalAlpha = 1.0, dest alpha of pixel eq 255 - browser blends src image data when you perform putImageData and original red, green, blue components corrupts due floating point errors. For example we have one pixel [1,129,130,131], let see putImageData(this pixel); getImageData() -> [1,128,130,131]; drawImage(toDataUrl()); ; getImageData -> [1,126,128,131] => |
NewerOlder