- Input events are difficult/impossible to hook into at framework level
- Angular uses html data-binding without user-defined interactions, or sometimes ng-click attributes (but still bound to a private scope). This logic is all lost somewhere deep in the internals, completely inaccessible to outside code.
- Ember uses an action filter in mustache (http://emberjs.com/guides/templates/actions/). Again, inaccessible internals...
- React uses on* attributes in JSX. It's possible to intercept them via
React.createElement(...)
, but associating the virtual DOM representation with the corresponding real DOM element is not possible without patching the DOM itself.
- Scope inheritance in angular makes it impossible to know what controller a given thing in the scope is coming from without modifying the core itself. (https://docs.angularjs.org/guide/controller#scope-inheritance-example)
- MV* approach between the different frameworks varies rather drastically.
- Angular has controllers, but the
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
// ==UserScript== | |
// @name Disable Jira Click Edit | |
// @namespace http://tampermonkey.net/ | |
// @version 0.1 | |
// @description Disable click edit in Jira issue descriptions | |
// @author fanuch | |
// @match https://*.atlassian.net/browse/* | |
// @icon https://www.google.com/s2/favicons?sz=64&domain=atlassian.net | |
// @grant none | |
// ==/UserScript== |
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
function betterPromise (executor) { | |
let args | |
const promise = new Promise((..._args) => { | |
args = _args | |
}) | |
executor.apply(null, args) | |
return promise |
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
$ ./configure && make test | |
creating ./icu_config.gypi | |
* Using ICU in deps/icu-small | |
creating ./icu_config.gypi | |
{ 'target_defaults': { 'cflags': [], | |
'default_configuration': 'Release', | |
'defines': [], | |
'include_dirs': [], | |
'libraries': []}, | |
'variables': { 'asan': 0, |
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
class Handler | |
def initialize | |
with self yield | |
end | |
def hello | |
puts "this should work..." | |
end | |
end |
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
var algorithm = crypto.getHashes()[0] | |
var hash = crypto.createHash(algorithm) // crypto entry | |
hash.update('foo') | |
fs.readFile(__filename, function (err, data) { | |
hash.update('bar') | |
var hashed = hash.digest() // crypto exit | |
done() | |
}) |
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
require 'openssl' | |
require 'net/http' | |
uri = URI.parse("https://semver.io/node/versions") | |
# uri = URI.parse("https://semver.io/iojs/versions") | |
http = Net::HTTP.new(uri.host, uri.port) | |
http.use_ssl = true | |
http.verify_mode = OpenSSL::SSL::VERIFY_NONE # read into this | |
result = http.get(uri.request_uri) |
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
function times (n, fn) { | |
return function () { | |
if (n > 0) { | |
n-- | |
return fn.apply(this, arguments) | |
} | |
} | |
} | |
var hello = times(2, function () { |
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
var Emitter = require('events').EventEmitter | |
var evil = new Emitter | |
evil.on('foo', function (get) { | |
console.log('privateThing is', get('privateThing')) | |
}) | |
function foo () { | |
var privateThing = 'secret' | |
evil.emit('foo', function (prop) { |
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
{ | |
"start": "node --harmony server.js", | |
"dev": "exec-parallel 'npm run watch' 'npm run watch:test' 'nodemon --harmony server.js'", | |
"test": "mocha --harmony", | |
"coverage": "npm run coverage:report", | |
"coverage:build": "rm -rf coverage && node --harmony istanbul cover _mocha", | |
"coverage:report": "npm run coverage:build && istanbul report", | |
"coverage:html": "npm run coverage && node-open coverage/lcov-report/index.html", | |
"build": "exec-parallel 'npm run build:js' 'npm run build:css'", | |
"build:js": "browserify assets/js/main.js -o public/js/bundle.js", |
NewerOlder