Skip to content

Instantly share code, notes, and snippets.

View jonathanpike's full-sized avatar

Jonathan Pike jonathanpike

  • Fullscript
  • St. Albert, Alberta
View GitHub Profile
@jonathanpike
jonathanpike / webcrawler.go
Created March 6, 2017 14:49
Exercise: Web Crawler
package main
import (
"fmt"
"sync"
)
type Fetcher interface {
// Fetch returns the body of URL and
// a slice of URLs found on that page.

Cursor movement

  • h - move left
  • j - move down
  • k - move up
  • l - move right
  • w - jump by start of words (punctuation considered words)
  • W - jump by words (spaces separate words)
  • e - jump to end of words (punctuation considered words)
  • E - jump to end of words (no punctuation)
@jonathanpike
jonathanpike / tmux-cheatsheet.markdown
Created November 18, 2016 14:32 — forked from MohamedAlaa/tmux-cheatsheet.markdown
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname

Keybase proof

I hereby claim:

  • I am jonathanpike on github.
  • I am jonathanpike (https://keybase.io/jonathanpike) on keybase.
  • I have a public key whose fingerprint is 2F62 FA73 50D2 F10A 6D30 0137 7E8F 5585 F6B3 098B

To claim this, I am signing this object:

@jonathanpike
jonathanpike / go.css
Last active June 13, 2018 16:28
Go Train departures
.body {
background-color: #EFEFEF;
font-family: Arial, Verdana, Helvetica, Sans-Serif;
}
.flex-parent {
display: flex;
align-items: center;
justify-content: center;
}
@jonathanpike
jonathanpike / fib_inject.rb
Created December 10, 2015 19:51
One-liner Fibonacci Sequence
def fibonacci(num)
num.times.inject([0, 1]) { |arr, i| arr << arr[-2] + arr[-1] }
end
@jonathanpike
jonathanpike / c9-postgres.md
Last active February 28, 2018 00:59
Cloud9 Postgres Setup with Standard Postgres and Rails Settings

Set Up Postgresql on Cloud9 Online IDE

Start Postgresql on Cloud9

Type sudo service postgresql start

Set Up User

A default Postgres installation has a user account with the following information:

window.onLoad = function() {
function dayOfWeek() {
var date = new Date();
var days = ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"];
return days[date.getDay()];
}
document.getElementById("day").innerHTML = dayOfWeek();
};
class Sample
def initialize(&block)
@block = block
end
def method
@block.call
end
end
class BinaryTree
attr_accessor :payload, :left, :right
def initialize(payload, left, right)
@payload = payload
@left = left
@right = right
end
end