Skip to content

Instantly share code, notes, and snippets.

Writing tests

Nick Clifford nickbclifford

Writing tests
View GitHub Profile
nickbclifford / .eslintrc.json
Last active Jul 18, 2020
ESLint minimal example
View .eslintrc.json
"extends": "@mymicds",
"parserOptions": {
"project": "./tsconfig.json"

Keybase proof

I hereby claim:

  • I am nickbclifford on github.
  • I am nickbclifford ( on keybase.
  • I have a public key ASBnl0waVQaJcxp-OpoEv9IJfpRSqoTBtqVnBNxmip8Tzwo

To claim this, I am signing this object:

require "big"
require "http/client"
require "json"
def send_contract_call(to address, data)
JSON.parse("localhost:8545", body: {
"jsonrpc" => "2.0",
"method" => "eth_call",
"params" => [{
"to" => address,
nickbclifford /
Last active Jul 16, 2020
How to automatically deploy code to a server using Travis CI

Auto-Deploying via Travis CI

Because Travis CI can automatically execute scripts after successfully (or unsuccessfully!) executing tests, it is an obvious choice for a deployment tool. In order to deploy to a Git repository on a remote server, the process generally is as follows:

  • Set up SSH keys
  • Add the server's copy of the repository as a Git remote
  • Push to the remote
  • SSH into the server and execute any installation/compilation/miscellaneous commands

Before even touching .travis.yml...


nickbclifford / dominos.js
Last active Feb 18, 2017
Domino's Pizza JavaScript challenge
View dominos.js
function say(firstStr) {
// gotta love currying!
return function(secondStr) {
function hyphenSeparate(str) {
return str.replace(/[.,'"?!]/g, '') // remove punctuation
.split('') // split into array of chars
.reduce((a, v) => a + '-' + v); // concatenate with hyphens in between
return hyphenSeparate(firstStr) + ' ' + hyphenSeparate(secondStr);
You can’t perform that action at this time.