-
Install the React Developer Tools Chrome Extension.
-
Go to the egghead website, i.e. Getting Started with Redux
-
Click
View -> Developer -> Javascript Console
, then theReact
tab, then the<NextUpLessonList ...>
tag. -
Click back to the
Console
tab, then run:
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
#!/usr/bin/env python | |
""" | |
===================================== | |
PEP 20 (The Zen of Python) by example | |
===================================== | |
Usage: %prog | |
:Author: Hunter Blanks, [email protected] / [email protected] |
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
const fs = require('fs'); | |
var rs = fs.createReadStream(src); | |
var ws = fs.createWriteStream(dst); | |
rs.on('data', function (chunk) { | |
if (ws.write(chunk) === false) { | |
rs.pause(); | |
} | |
}); |
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
/* | |
A directory tree like below. | |
A | |
/ \ | |
B C | |
/ \ \ | |
D E F | |
The access order of deep first and pre-order traversal algorithm should be : |
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 Observable: | |
def __init__(self, *args, **kwargs): | |
self.__observers = [] | |
def register_observer(self, observer): | |
self.__observers.append(observer) | |
def notify_observers(self, *args, **kwargs): | |
for observer in self.__observers: | |
observer.notify(self, *args, **kwargs) |
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
from dispatch import Signal | |
# The Signal object (think of it as an exchange) | |
log_it = Signal(providing_args=['level', 'message']) | |
# These functions are receivers (subscribers). They will receive | |
# the signal (message) sent (published) by the sender (publisher). | |
def simple_receiver(**kwargs): | |
message, level = kwargs['message'], kwargs['level'] | |
print 'Receiver # 1' |
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
let o = new Observable(observer => { | |
const token = doAsyncThing((err, value) => { | |
if (err) { | |
observer.error(err); | |
} else { | |
observer.next(value); | |
observer.complete(); | |
} | |
}); | |
return () => { |
#RxJS 5 Operators By Example
UPDATE: I have moved the contents of this gist plus more to https://github.com/btroncone/learn-rxjs and http://www.learnrxjs.io. For expanded examples, explanations, and resources, please check out this new location!
A complete list of RxJS 5 operators with easy to understand explanations and runnable examples.
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
import os | |
import smtplib | |
from email.mime.application import MIMEApplication | |
from email.mime.multipart import MIMEMultipart | |
from email.mime.text import MIMEText | |
def main(): |
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
#======================================================================== | |
# | |
# Sample xpdfrc file | |
# | |
# The Xpdf tools look for a config file in two places: | |
# 1. ~/.xpdfrc | |
# 2. in a system-wide directory, typically /usr/local/etc/xpdfrc | |
# | |
# This sample config file demonstrates some of the more common | |
# configuration options. Everything here is commented out. You |
OlderNewer