Couldn't find the text of this for a while...
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
1.9.3p286 :001 > class MyClass | |
1.9.3p286 :002?> attr_accessor :name | |
1.9.3p286 :003?> end | |
=> nil | |
1.9.3p286 :004 > hash = {} | |
=> {} | |
1.9.3p286 :005 > me = MyClass.new | |
=> #<MyClass:0x00000001f83bc0> | |
1.9.3p286 :006 > hash.store me.to_s, me | |
=> #<MyClass:0x00000001f83bc0> |
I'm having trouble understanding the benefit of require.js. Can you help me out? I imagine other developers have a similar interest.
From Require.js - Why AMD:
The AMD format comes from wanting a module format that was better than today's "write a bunch of script tags with implicit dependencies that you have to manually order"
I don't quite understand why this methodology is so bad. The difficult part is that you have to manually order dependencies. But the benefit is that you don't have an additional layer of abstraction.
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> | |
<!-- | |
- controllerpath should default to /*, it's just the typical thing | |
- controllersync ensures the controller is always there | |
--> | |
<html controller="respimg.js" controllerpath="/*" controllersync> | |
<!-- ... --> | |
<img src='my-shiny-donkey.png#resp-me'> | |
</html> |
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
[My initial list:] | |
DRM | |
speed for superhi-perf games | |
app store placement | |
source-code secrecy | |
[list compiled from other people's twitter answers; thanks all!] | |
pushing native notifications when they're not in the "app" (several people said this) |
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
function AssertionError(msg) { | |
this.message = msg || ""; | |
this.name = "AssertionError"; | |
} | |
AssertionError.prototype = Error.prototype; | |
/* Call assert(cond, description1, ...) | |
An AssertionError will be thrown if the cond is false. All parameters will be logged to the console, | |
and be part of the error. | |
*/ |
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
window.S = function(s) { | |
return document[{ | |
'#': 'getElementById', | |
'.': 'getElementsByClassName', | |
'@': 'getElementsByName', | |
'=': 'getElementsByTagName'}[s[0]] | |
|| 'querySelectorAll'](s.slice(1)) | |
}; | |
// [S('#header'), S('.container'), S('?div')] |
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
// based on https://gist.github.com/Potfur/5576225 & https://github.com/james2doyle/saltjs | |
// more info: https://plus.google.com/109231487156400680487/posts/63eZzzrBSb6 | |
window.$ = function(s) { | |
var c = { | |
'#': 'ById', | |
'.': 'sByClassName', | |
'@': 'sByName', | |
'=': 'sByTagName'}[s[0]]; | |
return document[c?'getElement'+c:'querySelectorAll'](s.slice(1)) | |
}; |
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
''' | |
Redhost functionality | |
''' | |
# Import salt libs | |
import salt.utils | |
def install_redis(): | |
''' |
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
user=> (def foo 'hello) | |
#'user/foo | |
user=> (defn bar [] foo) | |
#'user/bar | |
user=> (bar) | |
hello | |
user=> (def foo 'world) | |
#'user/foo | |
user=> (bar) | |
world |