Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@mattdeboard
mattdeboard / central ac cycle.md
Last active October 11, 2020 00:54
Central AC system description

System Component Inputs & Outputs

Refrigerant Cycle

Evaporator

Composed of evaporator coils & refrigerant line.

Refrigerant passing through coils absorbs thermal energy from unconditioned air, resulting in cooler & drier air. This air is discharged into the living space.

  • Input: Low-pressure, low-temp liquid/vapor-mix coolant.
    • From: TXV
  • Output: Low-pressure, low-temperator coolant vapor.
@mbilokonsky
mbilokonsky / thinking_like_a_function.md
Last active October 25, 2021 14:47
Thinking Like a Function

Thinking Like a Function

Part 1: What's a function?

As a software engineer, you probably think of a function as a unit of code that takes some arguments and returns some value, eg:

 function square(x) { 
   return x * x;
 }
@fokusferit
fokusferit / enzyme_render_diffs.md
Last active April 15, 2024 09:41
Difference between Shallow, Mount and render of Enzyme

Shallow

Real unit test (isolation, no children render)

Simple shallow

Calls:

  • constructor
  • render
@mattdeboard
mattdeboard / num_to_string.py
Last active March 2, 2020 18:10
Turns abitrary number into its string representation (e.g. 100 -> "one hundred") up to 999,999,999,999,999,999,999,999,999,999,999,999,999
#!/usr/bin/env python
from math import ceil, floor, log10
ones = {
1: 'one',
2: 'two',
3: 'three',
4: 'four',
5: 'five',
@AsaAyers
AsaAyers / you_dont_need_coffeescript.md
Created September 20, 2016 15:52
You Don't Need CoffeeScript

You Don't Need CoffeeScript

It's time to replace CoffeeScript with Babel and CoffeeLint with eslint.

CoffeeScript was useful a few years ago. It provided many features that JavaScript was lacking. It gave us the fat arrow (lexical this functions), default parameters, destructuring assignments, splats (spread operator), a class keyword, block strings, and more. Everything in the list above is now part of the JavaScript standard. JavaScript is moving forward and gaining

@mattdeboard
mattdeboard / .bash_profile
Created November 16, 2015 20:06 — forked from fieg/.bash_profile
.bash_profile for OSX including autocomplete for ssh hosts, default variables and some aliases
_complete_ssh_hosts ()
{
COMPREPLY=()
cur="${COMP_WORDS[COMP_CWORD]}"
comp_ssh_hosts=`cat ~/.ssh/known_hosts | \
cut -f 1 -d ' ' | \
sed -e s/,.*//g | \
grep -v ^# | \
uniq | \
grep -v "\[" ;
@nanvel
nanvel / s3.py
Created July 24, 2015 14:56
Async s3 uploader for tornado
"""
Async Tornado S3 uploader with AWS4 sign.
https://gist.github.com/stalkerg/63bad3ea49be6268df49
Edited by @nanvel 2015-07-24
Usage example:
.. code-block:: python
@eliangcs
eliangcs / pyenv+virtualenv.md
Last active June 8, 2023 07:46
Cheatsheet: pyenv, virtualenvwrapper, and pip

Cheatsheet: pyenv, virtualenvwrapper, and pip

Installation (for Mac OS)

Install pyenv with brew

brew update
brew install pyenv
  • e675f89...a7822d3 master -> master (forced update)
  1. Create a local branch where master belongs.

    git checkout -b fixmaster e675f89

a. If someone pushed to master between the last time you pulled and now you'll need to go to github to get the full hash. Go to https://github.com/<owner>/<repo>/commit/e675f89 and it'll have the full hash on the page.

`git fetch origin <full hash of e675f89>`

git checkout -b fixmaster e675f89

#!/bin/bash
# You can run this to make fetch automatically prune any time you pull or
# fetch.
#
# git config remote.origin.prune true
git fetch --prune
# Abort early if there are local changes
git checkout master || exit