gunicorn run:app --workers=9
gunicorn run:app --workers=9 --worker-class=meinheld.gmeinheld.MeinheldWorker
Macbook Pro 2015 Python 3.7
Framework | Server | Req/s | Max latency | +/- Stdev |
---|
# Enable Realtek driver power management, this is the default value | |
REG ADD "HKCU\Software\Realtek\RAVCpl64\PowerMgnt" /v "Enabled" /t REG_DWORD /d 1 /f | |
# Disable Realtek driver power management, sometimes fixes realtek popping sound | |
REG ADD "HKCU\Software\Realtek\RAVCpl64\PowerMgnt" /v "Enabled" /t REG_DWORD /d 0 /f | |
# Replace XXXX with the corresponding key that has "Realtek" in the "DriverDesc", find using regedit | |
REG ADD "HKLM\SYSTEM\CurrentControlSet\Control\Class\{4d36e96c-e325-11ce-bfc1-08002be10318}\XXXX\PowerSettings" /v "IdlePowerState" /t REG_BINARY /d "ffffffff" /f | |
REG ADD "HKLM\SYSTEM\CurrentControlSet\Control\Class\{4d36e96c-e325-11ce-bfc1-08002be10318}\XXXX\PowerSettings" /v "PerformanceIdleTime" /t REG_BINARY /d "ffffffff" /f | |
# Example if class is in 0000 |
gunicorn run:app --workers=9
gunicorn run:app --workers=9 --worker-class=meinheld.gmeinheld.MeinheldWorker
Macbook Pro 2015 Python 3.7
Framework | Server | Req/s | Max latency | +/- Stdev |
---|
# Generate a 440 Hz square waveform in Pygame by building an array of samples and play | |
# it for 5 seconds. Change the hard-coded 440 to another value to generate a different | |
# pitch. | |
# | |
# Run with the following command: | |
# python pygame-play-tone.py | |
from array import array | |
from time import sleep |
node { | |
echo 'Results included as an inline comment exactly how they are returned as of Jenkins 2.121, with $BUILD_NUMBER = 1' | |
echo 'No quotes, pipeline command in single quotes' | |
sh 'echo $BUILD_NUMBER' // 1 | |
echo 'Double quotes are silently dropped' | |
sh 'echo "$BUILD_NUMBER"' // 1 | |
echo 'Even escaped with a single backslash they are dropped' | |
sh 'echo \"$BUILD_NUMBER\"' // 1 | |
echo 'Using two backslashes, the quotes are preserved' | |
sh 'echo \\"$BUILD_NUMBER\\"' // "1" |
Sometimes you may want to undo a whole commit with all changes. Instead of going through all the changes manually, you can simply tell git to revert a commit, which does not even have to be the last one. Reverting a commit means to create a new commit that undoes all changes that were made in the bad commit. Just like above, the bad commit remains there, but it no longer affects the the current master and any future commits on top of it.
git revert {commit_id}'
Deleting the last commit is the easiest case. Let's say we have a remote origin with branch master that currently points to commit dd61ab32. We want to remove the top commit. Translated to git terminology, we want to force the master branch of the origin remote repository to the parent of dd61ab32:
#!/usr/bin/env bash | |
echo "Benchmark for Fibonacci numbers with Python3, Cython and PyPy" | |
echo ' | |
def fib(n): | |
"Return the n-th Fibonacci number." | |
i = 0 | |
a, b = 0, 1 | |
if n < 2: |
# -*- coding: utf-8 -*- | |
from bottle import route, run | |
@route('/') | |
def index(): | |
return '<h1>Hello World/h1>' | |
run(host='localhost', port=8000) |
Python syntax here : 2.7 - online REPL
Javascript ES6 via Babel transpilation - online REPL
import math
brew install git bash-completion
Configure things:
git config --global user.name "Your Name"
git config --global user.email "you@example.com"