"Let's create an ES6 class!" you say. "Let's give it a private variable x."
class Foo {
constructor(x) {
this.x = x;
}
getX() {Python syntax here : 2.7 - online REPL
Javascript ES6 via Babel transpilation - online REPL
import math| * { | |
| font-size: 12pt; | |
| font-family: monospace; | |
| font-weight: normal; | |
| font-style: normal; | |
| text-decoration: none; | |
| color: black; | |
| cursor: default; | |
| } |
(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.
| var f = function() { | |
| var v = speechSynthesis.getVoices().filter(function(v) { return v.name == 'Hysterical'; })[0], | |
| s = ["ahahahaha", "stop it", "don't tickle me"], | |
| t = new SpeechSynthesisUtterance(s[~~(Math.random()*s.length)]); | |
| t.voice = v; speechSynthesis.speak(t); | |
| }; | |
| Array.prototype.slice.call(document.querySelectorAll('a')).forEach(function(a) { | |
| a.addEventListener('mouseover', f); | |
| }); |
| var log = console.log; | |
| console.log = function(){ | |
| log.call(console, '%c' + [].slice.call(arguments).join(' '), 'color:transparent;text-shadow:0 0 2px rgba(0,0,0,.5);') | |
| }; |
| import urllib2 | |
| import re | |
| import sys | |
| from collections import defaultdict | |
| from random import random | |
| """ | |
| PLEASE DO NOT RUN THIS QUOTED CODE FOR THE SAKE OF daemonology's SERVER, IT IS | |
| NOT MY SERVER AND I FEEL BAD FOR ABUSING IT. JUST GET THE RESULTS OF THE | |
| CRAWL HERE: http://pastebin.com/raw.php?i=nqpsnTtW AND SAVE THEM TO "archive.txt" |
| <?php | |
| /** | |
| * A helper file for Laravel 5, to provide autocomplete information to your IDE | |
| * Generated for Laravel 5.5.13 on 2017-09-28. | |
| * | |
| * @author Barry vd. Heuvel <[email protected]> | |
| * @see https://github.com/barryvdh/laravel-ide-helper | |
| */ | |
| namespace { | |
| exit("This file should not be included, only analyzed by your IDE"); |
This article has been given a more permanent home on my blog. Also, since it was first written, the development of the Promises/A+ specification has made the original emphasis on Promises/A seem somewhat outdated.
Promises are a software abstraction that makes working with asynchronous operations much more pleasant. In the most basic definition, your code will move from continuation-passing style:
getTweetsFor("domenic", function (err, results) {
// the rest of your code goes here.In August 2007 a hacker found a way to expose the PHP source code on facebook.com. He retrieved two files and then emailed them to me, and I wrote about the issue:
http://techcrunch.com/2007/08/11/facebook-source-code-leaked/
It became a big deal:
http://www.techmeme.com/070812/p1#a070812p1
The two files are index.php (the homepage) and search.php (the search page)