- touch events to make web apps feel fast
- default mobile css overrides (-webkit-touch-callout: none; etc)
- using zepto to make mobile web apps
- client side templating and routing for quick loading apps
- supporting retina devices with sprites
- css3 flexible box model and column layouts for responsive web apps
- using phonegap to deploy web apps as native
- web first development workflow (chrome dev tools, safari debugging)
- how to submit a web app to the app store + google play
- cross platform mobile code via feature detection
PopKit.Color = SC.Object.extend SC.Copyable, | |
rgb: (-> | |
PopKit.Color.hsbToRgb(@get("hsb")) | |
).property("hsb") | |
copy: -> PopKit.Color.create(hsb: @get("hsb")) | |
PopKit.Color.reopenClass | |
hsbToRgb: (hsb) -> | |
[h, s, b] = hsb |
#!/bin/bash | |
rm -rf dist | |
rm -rf build | |
rm -rf *.egg-info | |
python setup.py install |
If you must nest functions in a way that requires access to multiple this', alias outer this to something meaningful - describe the value it's holding. Treat this as the invisible first argument.
In general though, avoiding the situation (nested functions and frivolous use of this
) will frequently produce clearer results.
I was accidentally included in a discussion on how to best name this
in nested functions in JavaScript. +1's were given to this suggestion of using _this
.
Giving style advice on naming nested this
without a meaningful context isn't too helpful in my opinion. Examples below have been altered to have at least some context, although a completely contrived and stupid one.
(function( exports ) { | |
function EventEmitter() {} | |
EventEmitter.prototype.emit = function() { | |
var type, handlers, args, listeners; | |
type = arguments[0]; | |
args = [].slice.call( arguments, 1 ); |
Locate the section for your github remote in the .git/config
file. It looks like this:
[remote "origin"]
fetch = +refs/heads/*:refs/remotes/origin/*
url = [email protected]:joyent/node.git
Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/*
to this section. Obviously, change the github url to match your project's URL. It ends up looking like this:
//in your application, rather than using window.location to get the current url | |
App.getLocation = function(){ | |
return window.location.protocol + '//' + window.location.host | |
+ '/' + Backbone.history.options.root + Backbone.history.getFragment() | |
} |
var parser = document.createElement('a'); | |
parser.href = "http://example.com:3000/pathname/?search=test#hash"; | |
parser.protocol; // => "http:" | |
parser.hostname; // => "example.com" | |
parser.port; // => "3000" | |
parser.pathname; // => "/pathname/" | |
parser.search; // => "?search=test" | |
parser.hash; // => "#hash" | |
parser.host; // => "example.com:3000" |
<script> | |
document.write('<script src=' + | |
('__proto__' in {} ? 'zepto' : 'jquery') + | |
'.js><\/script>') | |
</script> |
// Use @include colorize('image.png', red, 0.5) | |
@mixin colorize($image, $color, $opacity) { | |
background: $color; | |
$color: transparentize($color, 1 - $opacity); | |
background: -webkit-linear-gradient(left, $color, $color), url($image); | |
background: -moz-linear-gradient(left, $color, $color), url($image); | |
background: -ms-linear-gradient(left, $color, $color), url($image); | |
background: -o-linear-gradient(left, $color, $color), url($image); | |
} |