Skip to content

Instantly share code, notes, and snippets.

@ltfschoen
ltfschoen / coder_academy_software_development_core_concepts_resources_exercises.md
Last active October 18, 2017 09:01
Coder Academy - Software Development Core Concepts, Resources, and Exercises

Guidelines

  • Questions and Answers should be generic high-level concepts without details
  • Questions and Answers must be concise and not longer than 100 characters
  • Maximum of 2 resources

Legend:

  • Abbreviations
    • Q: Questions
    • A: Answers
  • R: Resources
@ltfschoen
ltfschoen / pr.md
Created October 21, 2017 09:57 — forked from houjunchen/pr.md
Checkout Bitbucket Server pull requests locally

Locate the section for your Bitbucket Server remote in the .git/config file. It looks like this:

[remote "origin"]
	fetch = +refs/heads/*:refs/remotes/origin/*
	url = git@<your repo url>

Now add the line fetch = +refs/pull-requests/*/from:refs/remotes/origin/pull-requests/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this:

@ltfschoen
ltfschoen / algorithm_summary.md
Created October 23, 2017 21:04
Algorithm Summary
  • About Algorithms

  • Heaps

    • About - is a container satisfying the Heap Property
      • Example - Refer to lib/containers/heap.rb
      • Heap class's method complexities
        • Time Complexity: O(1) - push (insert new tree with single node, has_key?, next (of value), next_key, clear, empty?, merge (link two heaps), pop
Verifying my Blockstack ID is secured with the address 1Nh3rijrCtcR32syFDa5Xo5p9hHE65unRL https://explorer.blockstack.org/address/1Nh3rijrCtcR32syFDa5Xo5p9hHE65unRL
import collections
import random
import json
import hashlib
def hexhash(x):
return '0x' + hashlib.sha224(str(x)).hexdigest()[:6]
@ltfschoen
ltfschoen / launch.sh
Created November 30, 2017 06:46
Launch multiple bash terminal tab windows with one command
# Launch multiple bash terminal tab windows by running the command `bash launch.sh`
#!/bin/bash
# File: ~/launch.sh
# Original Code Reference: http://dan.doezema.com/2013/04/programmatically-create-title-tabs-within-the-mac-os-x-terminal-app/
# New-BSD License by Original Author Daniel Doezema http://dan.doezema.com/licenses/new-bsd/
# Modified by Luke Schoen in 2017 to include loading new tabs such as client and server and automatically open webpage in browser.
@ltfschoen
ltfschoen / docker-test.sh
Created December 4, 2017 20:54
docker-test
FROM ubuntu:latest
# trusty
RUN apt-get update
RUN apt-get install -y wget
# Add C compiler into $PATH. Includes libtool
RUN apt-get install -y build-essential
# Add zlib to decompress data on Ubuntu 14+ and Python 3.7+
RUN apt-get install -y zlib1g-dev
# Validate SHA256 against provided Checksum
shasum -a 256 parity-1.8.3-macos-installer.pkg
# zip
tar -cvzf jpegarchive.tar.gz /path/to/images/*.jpg
# Unzip a .tar.gz file https://gist.github.com/renatomattos2912/9329215
gunzip -c <FILENAME>.tar.gz | tar xopf -
# http://osxdaily.com/2012/04/05/create-tar-gzip/
// MIT
const React = window.React;
const { Component } = React;
const PRICE_URL = 'https://api.etherscan.io/api?module=stats&action=ethprice';
const PRICE_OPTIONS = {
method: 'GET',
mode: 'cors',
headers: {
@ltfschoen
ltfschoen / query_string_to_map.ex
Created January 28, 2018 07:38
Elixir Convert Query String Parameters into Map (Key/Value Pairs)
# Convert Query String Parameters into Map (Key/Value Pairs)
# Output is: `%{"from" => "ME", "proof" => "PROVEN", "to" => "YOU", "to_index" => "THERE"}`
String.split("from=ME&to=YOU&to_index=THERE&proof=PROVEN", ~r/&|=/) |> Enum.chunk(2) |> Map.new(fn [k, v] -> {k, v} end)