Skip to content

Instantly share code, notes, and snippets.

Avatar

Sam Daitzman sdaitzman

View GitHub Profile
@sdaitzman
sdaitzman / draw.py
Created Oct 12, 2021 — forked from korakot/draw.py
Drawing on Google Colab
View draw.py
from IPython.display import HTML, Image
from google.colab.output import eval_js
from base64 import b64decode
canvas_html = """
<canvas width=%d height=%d></canvas>
<button>Finish</button>
<script>
var canvas = document.querySelector('canvas')
var ctx = canvas.getContext('2d')
@sdaitzman
sdaitzman / PIDClass.cpp
Created Nov 7, 2019
A PID class (with methods) implemented for Principles of Engineering, Olin College of Engineering.
View PIDClass.cpp
class PID_Controller {
public:
// initialize variables used in the loop
float previousError = 0;
float error = 0;
float integral = 0;
float derivative = 0;
float output = 0;
@sdaitzman
sdaitzman / keybase.md
Created Jan 22, 2019
KeyBase identity verification for Sam Daitzman
View keybase.md

Keybase proof

I hereby claim:

  • I am sdaitzman on github.
  • I am sdaitzman (https://keybase.io/sdaitzman) on keybase.
  • I have a public key ASB7-C6OAVkFxOVkO6MHVG2kXSloI5RFTJuKX9HxX3F8CQo

To claim this, I am signing this object:

View ModSimPyColab.py
# Imports
from IPython.display import clear_output
import os
import time
# Install Python libraries
!pip3 install pandas seaborn sympy beautifulsoup4 lxml pint scipy==1.1.0 numpy
# Removes code before re-downloading it
!rm -rf ./ModSimPy
@sdaitzman
sdaitzman / gist:f1ecd8a033f92b0e97a8
Created Nov 16, 2014
NPM results from airsonos install
View gist:f1ecd8a033f92b0e97a8
samuel@blackbook ~> sudo npm install -g airsonos
npm http GET https://registry.npmjs.org/airsonos
npm http 304 https://registry.npmjs.org/airsonos
npm http GET https://registry.npmjs.org/portastic/0.0.1
npm http GET https://registry.npmjs.org/lodash
npm http GET https://registry.npmjs.org/sonos/0.6.1
npm http GET https://registry.npmjs.org/lame/1.1.1
npm http GET https://registry.npmjs.org/nodetunes/0.0.19
npm http GET https://registry.npmjs.org/nicercast/0.0.6
npm http GET https://registry.npmjs.org/throttle
@sdaitzman
sdaitzman / rc.local
Created Nov 14, 2014
power-saving /etc/rc.local tweaks for Elementary OS Freya on mid-2012 rMBP and integrated graphics
View rc.local
#!/bin/sh -e
#
# rc.local
#
# This script is executed at the end of each multiuser runlevel.
# Make sure that the script will "exit 0" on success or any other
# value on error.
#
# In order to enable or disable this script just change the execution
# bits.
@sdaitzman
sdaitzman / refind_linux.conf
Created Nov 14, 2014
refind_linux.conf for mid-2012 retina macbook pro integrated graphics on elementary os
View refind_linux.conf
"Standard boot options" "ro root=UUID=7a9990da-8a2b-4c23-b547-ded94578fefc quiet splash pcie_aspm=force drm.vblankoffdelay=1 i915.i915_enable_rc6=1 i915.i915_enable_fbc=1 i915.lvds_downclock=1 libata.force=noncq"
"Boot with Intel PState enabled" "ro root=UUID=7a9990da-8a2b-4c23-b547-ded94578fefc quiet splash pcie_aspm=force drm.vblankoffdelay=1 i915.i915_enable_rc6=1 i915.i915_enable_fbc=1 i915.lvds_downclock=1 libata.force=noncq intel_pstate=enable"
"Boot with minimal options - more stable" "ro root=UUID=7a9990da-8a2b-4c23-b547-ded94578fefc"
"Boot to single-user mode" "ro root=UUID=7a9990da-8a2b-4c23-b547-ded94578fefc single"
"Boot into Recovery Mode" "ro root=UUID=7a9990da-8a2b-4c23-b547-ded94578fefc recovery nomodeset"
@sdaitzman
sdaitzman / 01.config
Last active Aug 29, 2015
homebrew debug info for a problem
View 01.config
checking if autoconf needs to be run... no
checking if autoheader needs to be run... no
checking whether the C++ compiler works... yes
checking for C++ compiler default output file name... a.out
checking for suffix of executables...
checking whether we are cross compiling... no
checking for suffix of object files... o
checking whether we are using the GNU C++ compiler... yes
checking whether clang++ accepts -g... yes
checking for a BSD-compatible install... /usr/bin/install -c
View index.html
<div class="one">Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo.
</div>
<br><br>
<div class="two">Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo. Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultr
View dabblet.css
/**
* Dabblet logo
*/
html { background: white }
body {
width: 400px;
height: 300px;
margin-top: 60px;