Skip to content

Instantly share code, notes, and snippets.

Writing tests

Nick Clifford nickbclifford

Writing tests
Block or report user

Report or block nickbclifford

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
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);
nickbclifford /
Last active Dec 11, 2019
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...


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,

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:

You can’t perform that action at this time.