As configured in my dotfiles.
start new:
tmux
start new with session name:
As configured in my dotfiles.
start new:
tmux
start new with session name:
#!/usr/bin/env bash | |
# MIT © Sindre Sorhus - sindresorhus.com | |
# git hook to run a command after `git pull` if a specified file was changed | |
# Run `chmod +x post-merge` to make it executable then put it into `.git/hooks/`. | |
changed_files="$(git diff-tree -r --name-only --no-commit-id ORIG_HEAD HEAD)" | |
check_run() { | |
echo "$changed_files" | grep --quiet "$1" && eval "$2" |
Here is an example how await
operator can be desugared into Promise-based code without ES6 generators (and state machines that emulate generators missing in ES5).
The only assumption is that there is Promise.resolve
(to create an empty promise for the loop finalization) among the globals.
Examples are written with "throw early" policy adoption: if promisified code has a synchronous preamble that throws we prefer to throw instead of creating rejected Promise.
Note that patterns below don't cover control flow breaks like return
, break
, continue
and throw
(for these breaks we should use a bit more complex structures).
On Tue Oct 27, 2015, history.state.gov began buckling under load, intermittently issuing 500 errors. Nginx's error log was sprinkled with the following errors:
2015/10/27 21:48:36 [crit] 2475#0: accept4() failed (24: Too many open files)
2015/10/27 21:48:36 [alert] 2475#0: *7163915 socket() failed (24: Too many open files) while connecting to upstream...
An article at http://www.cyberciti.biz/faq/linux-unix-nginx-too-many-open-files/ provided directions that mostly worked. Below are the steps we followed. The steps that diverged from the article's directions are marked with an *.
su
to run ulimit
on the nginx account, use ps aux | grep nginx
to locate nginx's process IDs. Then query each process's file handle limits using cat /proc/pid/limits
(where pid
is the process id retrieved from ps
). (Note: sudo
may be necessary on your system for the cat
command here, depending on your system.)fs.file-max = 70000
to /etc/sysctl.conf/* | |
-------------------------------------------------------- | |
Please note that this grouping is just for example... | |
You can rearrange POPs, remove or add dacaneters according to your needs. | |
-------------------------------------------------------- | |
First, we have to get all Cloudflare POP codes (three letter airport codes) from https://www.cloudflarestatus.com/ | |
North America is routed to Chigaco datacenter; | |
Europe, Africa and Middle East is routed to Amsterdam datacenter; |
const crypto = require('crypto'); | |
const base64url = require('base64url'); | |
const cbor = require('cbor'); | |
const jsrsasign = require('jsrsasign'); | |
const elliptic = require('elliptic'); | |
const NodeRSA = require('node-rsa'); | |
let COSEKEYS = { | |
'kty' : 1, | |
'alg' : 3, |
# this forces Arena into full screen mode on startup, set back to 3 to reset | |
# note that if you go into the Arena "Graphics" preference panel, it will reset all of these | |
# and you will need to run these commands again | |
defaults write com.wizards.mtga "Screenmanager Fullscreen mode" -integer 0 | |
defaults write com.wizards.mtga "Screenmanager Resolution Use Native" -integer 0 | |
# you can also replace the long complicated integer bit with any other scaled 16:9 | |
# resolution your system supports. | |
# to find the scaled resolutions, go to System Preferences --> Display and then | |
# divide the width by 16 and multiple by 9. on my personal system this ends up |
""" | |
Sign in to Xbox Live with OAUTH2 | |
1. Go to https://portal.azure.com/#blade/Microsoft_AAD_RegisteredApps/ApplicationsListBlade | |
2. Register new app ("+ New registration") | |
2.1. Enter a name for your app | |
2.2. Set "Supported account types" to "Personal Microsoft accounts only" | |
2.3. Click register | |
2.4. Choose "Redirect URIs" -> "Add a Redirect URI" | |
2.5. Click "Add a platform" -> "Mobile and desktop applications" |