type tmux in terminal
Windows:
- Create new window: Ctrl+b c
- Move to next window: Ctrl+b n
- Move to previos window: Ctrl+b p
- List all wondows: Ctrl+b w
Panes/Split:
type tmux in terminal
Windows:
Panes/Split:
| class MyStreamListener(tweepy.StreamListener): | |
| def __init__(self, api=None): | |
| super(MyStreamListener, self).__init__() | |
| self.num_tweets = 0 | |
| self.file = open("tweets.txt", "w") | |
| def on_status(self, status): | |
| tweet = status._json | |
| self.file.write( json.dumps(tweet) + '\n' ) | |
| self.num_tweets += 1 |
#Installing ngrok on OSX
Run the following two commands in Terminal to create the symlink.
# cd into your local bin directory| #!groovy | |
| import groovy.json.JsonOutput | |
| import groovy.json.JsonSlurper | |
| /* | |
| Please make sure to add the following environment variables: | |
| HEROKU_PREVIEW=<your heroku preview app> | |
| HEROKU_PREPRODUCTION=<your heroku pre-production app> | |
| HEROKU_PRODUCTION=<your heroku production app> |
| #!groovy | |
| docker.image('cloudbees/java-build-tools:0.0.6').inside { | |
| checkout([$class: 'GitSCM', | |
| branches: [[name: '*/master']], | |
| extensions: [ | |
| /* [$class: 'UserIdentity', email: '[email protected]', name: 'Jenkins as a Service'], */ | |
| [$class: 'WipeWorkspace'], | |
| [$class: 'LocalBranch', localBranch: 'master']], | |
| userRemoteConfigs: [[credentialsId: 'github-credentials', url: 'https://github.com/cyrille-leclerc/my-spring-boot-app.git']]]) |
| #!/bin/bash | |
| set -e | |
| if [ $# -eq 0 ]; then | |
| echo "USAGE: $0 plugin1 plugin2 ..." | |
| exit 1 | |
| fi | |
| plugin_dir=/var/lib/jenkins/plugins |
The 0.13.0 improvements to React Components are often framed as "es6 classes" but being able to use the new class syntax isn't really the big change. The main thing of note in 0.13 is that React Components are no longer special objects that need to be created using a specific method (createClass()). One of the benefits of this change is that you can use the es6 class syntax, but also tons of other patterns work as well!
Below are a few examples creating React components that all work as expected using a bunch of JS object creation patterns (https://github.com/getify/You-Dont-Know-JS/blob/master/this%20&%20object%20prototypes/ch4.md#mixins). All of the examples are of stateful components, and so need to delegate to React.Component for setState(), but if you have stateless components each patterns tends to get even simpler. The one major caveat with react components is that you need to assign props and context to the component instance otherwise the component will be static. The reason is
| import zmq | |
| import logging | |
| import uuid | |
| MASTER_ENDPOINT = 'tcp://127.0.0.1:5000' | |
| WORKER_ENDPOINT = 'tcp://127.0.0.1:5001' | |
| log = logging.getLogger(__name__) | |
| TASKS = {} |
| #!/bin/bash | |
| clear | |
| if [[ $EUID -ne 0 ]]; then | |
| echo "You must be root" 2>&1 | |
| exit 1 | |
| fi | |
| ARCH=$(uname -m) |