- Go to Digital Ocean
- Create new droplet
- London
- Ubuntu
- No apps
- Add SSH keys
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
import Ember from 'ember'; | |
export default Ember.Component.extend({ | |
tagName: '' | |
}); |
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
def flatten(list), do: flatten(list, []) |> Enum.reverse | |
def flatten([h | t], acc) when h == [], do: flatten(t, acc) | |
def flatten([h | t], acc) when is_list(h), do: flatten(t, flatten(h, acc)) | |
def flatten([h | t], acc), do: flatten(t, [h | acc]) | |
def flatten([], acc), do: acc |
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
const getBooleanTable = number => Array(Math.pow(2, number)) | |
.fill() | |
.map((_, idx) => idx) | |
.map(num => num.toString(2).padStart(number, '0')) | |
.map(stringOfBits => | |
stringOfBits.split('').map(bit => Boolean(parseInt(bit))) | |
) | |
console.log(getBooleanTable(3)) |
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
// Code from: http://patshaughnessy.net/2020/1/20/downloading-100000-files-using-async-rust | |
// | |
// Cargo.toml: | |
// [dependencies] | |
// tokio = { version = "0.2", features = ["full"] } | |
// reqwest = { version = "0.10", features = ["json"] } | |
// futures = "0.3" | |
use std::io::prelude::*; | |
use std::fs::File; |
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
const minute = 60; | |
const hour = minute * 60; | |
const day = hour * 24; | |
const week = day * 7; | |
const month = day * 30; | |
const year = day * 365; | |
/** | |
* Convert a date to a relative time string, such as | |
* "a minute ago", "in 2 hours", "yesterday", "3 months ago", etc. |
Here, we intend a component that can be used for something like a user menu in a nav. Maybe you've heard it called "popover" or something like that.
It is not meant to be a select
element, or used in a <form>
.
Goals:
- make a component that other developers can consume as an addon
- it should be accessible
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
// The global revision clock. Every time state changes, the clock increments. | |
let $REVISION = 0; | |
// The current dependency tracker. Whenever we compute a cache, we create a Set | |
// to track any dependencies that are used while computing. If no cache is | |
// computing, then the tracker is null. | |
let CURRENT_TRACKER = null; | |
// Storage represents a root value in the system - the actual state of our app. | |
class Storage { |
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
# Import module for data manipulation | |
import pandas as pd | |
# Import module for linear algebra | |
import numpy as np | |
# Import module for Fuzzy string matching | |
from fuzzywuzzy import fuzz, process | |
# Import module for regex | |
import re | |
# Import module for iteration | |
import itertools |