Estimated time: 10 minutes
#!/bin/bash | |
if [ $# -ne 1 ]; then | |
echo "Usage: $0 <submodule full name>" | |
exit 1 | |
fi | |
MODULE_NAME=$1 | |
MODULE_NAME_FOR_SED=$(echo $MODULE_NAME | sed -e 's/\//\\\//g') |
//server.js | |
const http = require('http'); | |
//const niv = require('npm-install-version'); | |
const chalkv2 = require('chalk'); | |
const multiRequire = require('./multiRequire'); | |
const chalkv1 = multiRequire().multiRequire('chalk','1.0.0'); | |
console.log('chalk v1'+chalkv1.blue(chalkv1.version)); | |
console.log('chalk v2'+chalkv2.blue(chalkv2.version)); | |
const hostname = '127.0.0.1'; |
// reducer.js | |
let initialState = 0; | |
function reducer (state=initialState, action) { | |
switch(action.type){ | |
case 'INCREMENT_COUNT': | |
return state + 1; | |
default: | |
return state | |
} |
import hashlib as hasher | |
import datetime as date | |
# Define what a Snakecoin block is | |
class Block: | |
def __init__(self, index, timestamp, data, previous_hash): | |
self.index = index | |
self.timestamp = timestamp | |
self.data = data | |
self.previous_hash = previous_hash |
A shady Internet business has been discovered.
The website has been made public by a whistle blower. We have enough evidence about the dirty deals they did. But to charge them we need to get hands on precise numbers about the transactions that happened on their platform.
Unfortunately no record of the transactions could be seized so far. The only hint we have is this one transaction:
Code is clean if it can be understood easily – by everyone on the team. Clean code can be read and enhanced by a developer other than its original author. With understandability comes readability, changeability, extensibility and maintainability.
- Follow standard conventions.
- Keep it simple stupid. Simpler is always better. Reduce complexity as much as possible.
- Boy scout rule. Leave the campground cleaner than you found it.
- Always find root cause. Always look for the root cause of a problem.
#Quick Guide
sudo atsutil databases -remove
atsutil server -shutdown
atsutil server -ping
#Extended Guide from http://doc.extensis.com/Font-Management-in-OSX-Best-Practices-Guide.pdf
It's not immediately obvious how to pull down the code for a PR and test it locally. But it's pretty easy. (This assumes you have a remote for the main repo named upstream
.)
Getting the PR code
-
Make note of the PR number. For example, Rod's latest is PR #37: Psiphon-Labs/psiphon-tunnel-core#37
-
Fetch the PR's pseudo-branch (or bookmark or rev pointer whatever the word is), and give it a local branch name. Here we'll name it
pr37
:
$ git fetch upstream pull/37/head:pr37
Manual super: Alternative Design where subclass constructors do not automatically call superclass constructors
This Gist presents a new design of class-based object construction in ES6 that does not require use of the two-phase @@create protocol.
One of the characteristics of this proposal is that subclass constructors must explicitly super invoke their superclass's constructor if they wish to use the base class' object allocation and initialization logic.
An alternative version of this design automatically invokes the base constructor in most situations.