Skip to content

Instantly share code, notes, and snippets.

Dustin Knopoff dustinknopoff

Block or report user

Report or block dustinknopoff

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
use std::convert::TryFrom;
#[derive(Debug, Copy, Clone)]
enum HttpMethod {
impl TryFrom<String> for HttpMethod {
dustinknopoff / def.yml
Created Jun 26, 2019
tmuxinator setup
View def.yml
# /Users/dknopoff/.config/tmuxinator/portal.yml
name: def
root: ~/Documents
# Optional tmux socket
# socket_name: foo
# Note that the pre and post options have been deprecated and will be replaced by
# project hooks.
dustinknopoff / list-color.go
Created Jun 26, 2019
Ideal go-jira template for use in tmux setup
View list-color.go
{{$w := sub termWidth 200 -}}
{{ range .issues }}{{color "green+bh"}}{{ | printf "%-12s" }}{{color "reset"}} {{color "yellow+bh"}}{{ .key | append ":" | printf "%-12s"}}{{color "reset"}} {{ .fields.summary | abbrev (sub $w 2) | printf (printf "%%-%ds" (sub $w 18)) }} {{color "blue+bh"}}{{if .fields.assignee }}{{ | printf "%12s" }}{{else}}<unassigned>{{end}}{{color "reset"}}
{{ end }}
dustinknopoff /
Last active Jun 25, 2019
some fibonacci sequence fns using fold
fn main() {
fn fibo_fancy(val: i32) -> i32 {
if val == 0 {
return 0
.fold((None, None), |acc, curr| {
let (m1, m2) = acc;
if curr <= 2 {
match (m1, m2) {
dustinknopoff /
Last active Jun 18, 2019
Is the string sorted?
fn is_sorted(input: &str) -> bool {
let input_iter: Vec<_> = input.chars().collect();
let initial = input_iter[0];
.fold(Some(initial), |acc, current| {
if acc != None {
if Some(current) >= acc {
return Some(current)
} else {
dustinknopoff /
Last active Jun 16, 2019
Is a Tree reflexive?
type OptionBranch = Option<Box<Tree>>;
struct Tree {
data: i32,
branches: (OptionBranch, OptionBranch)
impl Tree {
fn new(data: i32) -> Self {
View Brewfile
tap "filosottile/musl-cross"
tap "heroku/brew"
tap "homebrew/bundle"
tap "homebrew/cask"
tap "homebrew/cask-fonts"
tap "homebrew/core"
tap "neovim/neovim"
tap "redox-os/gcc_cross_compilers"
tap "sbdchd/skim"
tap "sergiobenitez/osxct"
View mbta_data.json
This file has been truncated, but you can view the full file.
"Red": {
"id": "Red",
"name": "Red Line",
"type": 1,
"options": {
"Ashmont/Braintree": 0,
"Alewife": 1
#!/usr/bin/env python3
import argparse
def naive_reverse(input_list: [str]):
new_list = []
size = len(input_list) - 1
for i in range(0, len(input_list)):
new_list.append(input_list[size - i])
return new_list
dustinknopoff /
Last active Jan 1, 2019
Pythonista compatible python script for keeping track of and visualizing your numerical answer to daily questions.

Daily Tracker

How to Install

This script is intended to run in Pythonista on iOS. It works equally well on desktop OSs. Installation instructions will be solely for Pythonista.

  1. Copy the contents of this
  2. Open a new file in Pythonista called and paste the contents.
  3. Click the wrench icon.
You can’t perform that action at this time.