Since Twitter doesn't have an edit button, it's a suitable host for JavaScript modules.
Source tweet: https://twitter.com/rauchg/status/712799807073419264
const leftPad = await requireFromTwitter('712799807073419264');Since Twitter doesn't have an edit button, it's a suitable host for JavaScript modules.
Source tweet: https://twitter.com/rauchg/status/712799807073419264
const leftPad = await requireFromTwitter('712799807073419264');Service Worker - offline support for the web
Progressive apps - high-res icon, splash screen, no URL bar, etc.
| let toImage = UIImage(named:"image.png") | |
| UIView.transitionWithView(self.imageView, | |
| duration:5, | |
| options: .TransitionCrossDissolve, | |
| animations: { self.imageView.image = toImage }, | |
| completion: nil) |
| { | |
| "name": "my-app", | |
| "version": "1.0.0", | |
| "description": "My test app", | |
| "main": "src/js/index.js", | |
| "scripts": { | |
| "jshint:dist": "jshint src/js/*.js", | |
| "jshint": "npm run jshint:dist", | |
| "jscs": "jscs src/*.js", | |
| "browserify": "browserify -s Validating -o ./dist/js/build.js ./lib/index.js", |
| # 內容 | |
| # repo 位置 | |
| - https://github.com/facebook/react | |
| - https://github.com/facebook/flux | |
| # 官網 | |
| - React | |
| * http://facebook.github.io/react/ |
| 'use strict'; | |
| /*****************NATIVE forEACH*********************/ | |
| Array.prototype.myEach = function(callback) { | |
| for (var i = 0; i < this.length; i++) | |
| callback(this[i], i, this); | |
| }; | |
| //tests |
| // === Arrays | |
| var [a, b] = [1, 2]; | |
| console.log(a, b); | |
| //=> 1 2 | |
| // Use from functions, only select from pattern | |
| var foo = () => [1, 2, 3]; |
| import base64 | |
| from django.core.files.base import ContentFile | |
| from rest_framework import serializers | |
| class Base64ImageField(serializers.ImageField): | |
| def from_native(self, data): | |
| if isinstance(data, basestring) and data.startswith('data:image'): | |
| # base64 encoded image - decode |