+ Green.Like all Byzantine agreement protocols, SCP makes no assumptions about the rational behavior of attackers.
- Red. Like all Byzantine agreement protocols, SCP makes no assumptions about the rational behavior of attackers.
Black. Like all Byzantine agreement protocols, SCP makes no assumptions about the rational behavior of attackers.
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
"use strict"; | |
var stackTrace = (new Error()).stack; // Only tested in latest FF and Chrome | |
var callerName = stackTrace.replace(/^Error\s+/, ''); // Sanitize Chrome | |
callerName = callerName.split("\n")[1]; // 1st item is this, 2nd item is caller | |
callerName = callerName.replace(/^\s+at Object./, ''); // Sanitize Chrome | |
callerName = callerName.replace(/ \(.+\)$/, ''); // Sanitize Chrome | |
callerName = callerName.replace(/\@.+/, ''); // Sanitize Firefox | |
console.log(callerName) |
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
// This formats dates like how Twitter does on their tweets I originally wrote | |
// this because I did not want to add an external dependency (such as moment) to | |
// my project for something so insignificant (date format). I couldn't have | |
// easily generated it on the server side since the dates are relative to the | |
// end user's browser's timezone (and I specifically wrote this to run on the | |
// client). | |
// | |
// Usage: twitterDateFormat(time) | |
// time can be anything JS' Date can understand |
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
#!/bin/bash | |
# tmux requires unrecognized OSC sequences to be wrapped with DCS tmux; | |
# <sequence> ST, and for all ESCs in <sequence> to be replaced with ESC ESC. It | |
# only accepts ESC backslash for ST. We use TERM instead of TMUX because TERM | |
# gets passed through ssh. | |
function print_osc() { | |
if [[ $TERM == screen* ]] ; then | |
printf "\033Ptmux;\033\033]" | |
else |
Eric Bidelman has documented some of the common workflows possible with headless Chrome over in https://developers.google.com/web/updates/2017/04/headless-chrome.
If you're looking at this in 2016 and beyond, I strongly recommend investigating real headless Chrome: https://chromium.googlesource.com/chromium/src/+/lkgr/headless/README.md
Windows and Mac users might find using Justin Ribeiro's Docker setup useful here while full support for these platforms is being worked out.
It's a common confusion about terminal colours... Actually we have this:
- plain ascii
- ansi escape codes (16 colour codes with bold/italic and background)
- 256 colour palette (216 colours + 16 ansi + 24 gray) (colors are 24bit)
- 24bit true colour ("888" colours (aka 16 milion))
printf "\x1b[${bg};2;${red};${green};${blue}m\n"
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
# Do this thing in order | |
# First, you should set up your ssh keys for github. If not, then you'll have to type a usenrame and password every time | |
# https://help.github.com/articles/generating-ssh-keys | |
# CD into where you want to store this project | |
# Adding the repository for the first time | |
# With ssh keys | |
git clone git@github.com:irisli/61b-network.git |
No need for homebrew or anything like that. Works with https://www.git-tower.com and the command line.
- Install https://gpgtools.org -- I'd suggest to do a customized install and deselect GPGMail.
- Create or import a key -- see below for https://keybase.io
- Run
gpg --list-secret-keys
and look forsec
, use the key ID for the next step - Configure
git
to use GPG -- replace the key with the one fromgpg --list-secret-keys
NewerOlder