It's now here, in The Programmer's Compendium. The content is the same as before, but being part of the compendium means that it's actively maintained.
In Ember, always use {{...}}, not {{{...}}}. Use Ember.String.htmlSafe as necessary in JavaScript (usually in a component)
to mark markup as HTML-safe. Never pass user-entered content directly to Ember.String.htmlSafe.
Ember has great XSS protection built in. The HTMLBars templating library will automatically run any interpolations through
htmlEscape for you. So
| /* | |
| ******************************************************************************** | |
| Golang - Asterisk and Ampersand Cheatsheet | |
| ******************************************************************************** | |
| Also available at: https://play.golang.org/p/lNpnS9j1ma | |
| Allowed: | |
| -------- | |
| p := Person{"Steve", 28} stores the value |
| // NOTICE 2020-04-18 | |
| // Please see the comments below about why this is not a great PRNG. | |
| // Read summary by @bryc here: | |
| // https://github.com/bryc/code/blob/master/jshash/PRNGs.md | |
| // Have a look at js-arbit which uses Alea: | |
| // https://github.com/blixt/js-arbit | |
| /** |
(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
WebSockets is a modern HTML5 standard which makes communication between client and server a lot more simpler than ever. We are all familiar with the technology of sockets. Sockets have been fundamental to network communication for a long time but usually the communication over the browser has been restricted. The general restrictions
- The server used to have a permanent listener while the client (aka browser) was not designated any fixed listener for a more long term connection. Hence, every communication was restricted to the client demanding and the server responding.
- This meant that unless the client requested for a particular resource, the server was unable to push such a resource to the client.
- This was detrimental since the client is then forced to check with the server at regular intervals. This meant a lot of libraries focused on optimizing asynchronous calls and identifying the response of asynchronous calls. Notably t
| // phantomjs --web-security=no most_used_css_property_names.js | |
| var urls = [ | |
| 'http://google.com', | |
| 'http://facebook.com', | |
| 'http://youtube.com', | |
| 'http://yahoo.com', | |
| 'https://github.com/', | |
| 'http://twitter.com/', | |
| 'http://en.wikipedia.org/wiki/Main_Page', |
| var Deferred = (function () { | |
| var states = { | |
| SUCCESS: 1, | |
| FAILURE: 2, | |
| COMPLETE: 3 | |
| }, | |
| Deferred; | |
| function updateCallbacks(requiredStates, callback) { |
| // 1: how could you rewrite the following to make it shorter? | |
| if (foo) { | |
| bar.doSomething(el); | |
| } else { | |
| bar.doSomethingElse(el); | |
| } | |