Skip to content

Instantly share code, notes, and snippets.

View davecan's full-sized avatar

David Cantrell davecan

View GitHub Profile
@davecan
davecan / jupyter_shortcuts.md
Created July 28, 2019 15:52 — forked from kidpixo/jupyter_shortcuts.md
Keyboard shortcuts for ipython notebook 3.1.0 / jupyter

Toc

Keyboard shortcuts

The IPython Notebook has two different keyboard input modes. Edit mode allows you to type code/text into a cell and is indicated by a green cell border. Command mode binds the keyboard to notebook level actions and is indicated by a grey cell border.

MacOS modifier keys:

  • ⌘ : Command

Summary

(research articles with TLDRs are at the end of this document)

Vitamin D

  • Get at least 30 minutes of summer sun (or "equivalent") each day, without sunscreen**, to allow the body to produce proper levels of Vitamin D and other chemicals (nitric oxide/etc) naturally.
  • If must supplement, get at least 5,000 IU/day, combine with K2 to prevent calcium accumulation in the blood, and consume with a fat to ensure proper absorption.
  • Target: 50-75ng/ml blood level.
  • We don't need to worry much about overdosing on D3
  • No LD50 (median lethal dose) has been calculated for humans but researchers use dog values as estimates, which means we would need to take 3,500 50,000IU capsules within 24 hours to have a 50% chance of dying.

Watch this: https://www.youtube.com/watch?v=dIFKmJ4wufc

  • Set up lab router -- simple $60 linksys router can work well enough -- run cable from the wifi router to the lab router
  • All devices in the lab go behind the lab router
    • Otherwise can cause DNS/DHCP conflicts & general chaos across the rest of the home network
    • Isolate the lab behind this internal router to avoid conflicts
  • Lab network must be on different subnet than the main home network
    • Because router is for routing between different subnets
    • So if labnet is on same subnet as homenet then router can't route properly
  • If homenet is on NAT network space 192.168.1.x then router's external port must be on the same network, e.g. have IP such as 192.168.1.2
@davecan
davecan / System Design.md
Created January 6, 2019 02:16 — forked from vasanthk/System Design.md
System Design Cheatsheet

System Design Cheatsheet

Picking the right architecture = Picking the right battles + Managing trade-offs

Basic Steps

  1. Clarify and agree on the scope of the system
  • User cases (description of sequences of events that, taken together, lead to a system doing something useful)
    • Who is going to use it?
    • How are they going to use it?

Super simple docker cheatsheet.

Build & deploy an app

First build the image:

docker build -t <desired_image_name> .

Example from when I built a container having a TCP/IP client script and TCP/IP server script, so I wanted a generic name:

@davecan
davecan / wsl_ubuntu_webpack_error_fix
Created November 20, 2017 19:26
Windows WSL Ubuntu npm webpack CSS error fix
// When using webpack under WSL Ubuntu the following error will be generated during "npm start":
//
// Error: EINVAL: invalid argument, "index.css" (or similar to this)
//
// This is apparently a bug in how Microsoft implemented the Ubuntu subsystem.
//
// The solution is to add the below code to the very top of the webpack config file. (above the imports is fine)
//
// See: https://github.com/webpack-contrib/extract-text-webpack-plugin/issues/440
@davecan
davecan / open_powershell_here.md
Last active May 3, 2024 16:45
How to enable "Open PowerShell Here" context menu in Windows 10
@davecan
davecan / git-dropbox-remote.md
Last active March 30, 2016 03:44 — forked from edavis/git-dropbox-remote.md
Use Dropbox as a git remote

Intro

Every developer eventually faces the challenge of managing their personal "dotfiles" among the different machines he or she uses.

This post details how I tackled this issue by using Dropbox as a git remote while avoiding the pitfalls of storing the repository itself in Dropbox.

In the beginning

@davecan
davecan / GetDropboxPath.ps1
Created March 23, 2016 23:36
Simple powershell function that returns the path to a local personal dropbox instance.
function GetDropboxPath
{
$jsonPartialPath = "\Dropbox\info.json"
$jsonAppdataPath = $env:APPDATA + $jsonPartialPath
$jsonLocalAppdataPath = $env:LOCALAPPDATA + $jsonPartialPath
if (test-path $jsonAppdataPath)
{
$jsonPath = $jsonAppdataPath
}