Skip to content

Instantly share code, notes, and snippets.

View briandk's full-sized avatar

Brian A. Danielak briandk

View GitHub Profile
@briandk
briandk / cmse201-learning-outcomes.md
Created January 8, 2019 21:40
cmse 201 intended learning outcomes as markdown

Thinking about learning objectives as a process of modeling

1 - Modeling begins before you ever touch a computer

  • How do I understand the system of interest?
  • Within that system, what phenomena am I interested in?
  • What entities do I think are relevant for my model?
  • How might I qualitatively describe entity relationships in the model? (Example: predators hunt prey, so predators should have some contribution to the reduction of prey.)
  • What simplifications do I know I’m making?
  • How can I express expectations of/predictions about the model? (E.g., with one wolf and 10 million rabbits, I don’t think there will be much of a predator effect. Or: here’s a sketch of the path I think this orbiting body might take. Or: based on my experiences with kerbal space program, I figure the object would take a path like this.)
@briandk
briandk / cmse201-learning-outcomes.html
Created January 8, 2019 21:30
CMSE 201 Intended Learning Outcomes
<h1 id="thinking-about-learning-objectives-as-a-process-of-modeling">Thinking about learning objectives as a process of modeling</h1>
<h2 id="1---modeling-begins-before-you-ever-touch-a-computer">1 - Modeling begins before you ever touch a computer</h2>
<ul>
<li>How do I understand the system of interest?</li>
<li>Within that system, what phenomena am I interested in?</li>
<li>What entities do I think are relevant for my model?</li>
<li>How might I qualitatively describe entity relationships in the model? (Example: predators hunt prey, so predators should have some contribution to the reduction of prey.)</li>
<li>What simplifications do I <em>know</em> I’m making?</li>
@briandk
briandk / anacondaPython.md
Last active August 22, 2018 13:59
Useful commands for Anaconda Python

Update to a newer version of anaconda

conda update --prefix /anaconda3 anaconda

Upgrade all conda packages to their latest version

conda update --all
@briandk
briandk / usefulCommands.md
Created August 1, 2018 13:28
Useful short commands. FAQs by me. As in, I frequently have these questions

Git

git remote prune origin prunes tracking branches not on the remote. Run with a -n flag to do a dry run. Source

@briandk
briandk / renderPropsInReact.jsx
Created June 1, 2018 19:55
Render props in React
class WrapperComponent extends React.Component {
render() {
const style = { border: "solid 1px " + this.props.color };
return <div style={style}>{this.props.children}</div>;
}
}
class HelloMessage extends React.Component {
render() {
var Wrapper = this.props.wrapper;
@briandk
briandk / one-liners.fish
Created April 23, 2018 15:17
Shell one-liner commands
# Remove untagged docker images
docker rmi (docker images | awk '/<none>/ {print $3}')
@briandk
briandk / TypeScriptExamples.md
Last active July 19, 2018 16:29
Example functions (and arrow functions) in Typescript with target `es2017`

Defining an Object Type

const myObject: { [key: string]: string } = {foo: 'bar'}

Annotating Function Types

With target=es2017 and TypeScript 2.8

@briandk
briandk / git-shortcuts.sh
Last active April 17, 2018 17:34
Useful git shortcuts
# via https://stackoverflow.com/questions/7726949/remove-local-branches-no-longer-on-remote#28464339
# prunes tracking branches not on the remote.
git remote prune origin
# lists branches that have been merged into the current branch.
git branch --merged
# deletes branches listed on standard input.
xargs git branch -d
@briandk
briandk / QuillDeltaToString.js
Created September 28, 2017 00:55
Converting a quill delta into a string
// Assuming the delta is entirely insert operations,
// this example wouuld convert bolded text to html bolded text.
// The key logic here is mapping over the insert ops,
// then joining the resulting array on the empty string
html = delta.slice(0, 500).ops.map(function(op) {
if (typeof op.insert !== 'string') return '';
let html = op.insert;
if (op.attributes.bold) {
html = '<strong>' + html + '</strong>';
}
@briandk
briandk / extendingClassesInJavaScript.js
Created June 30, 2017 01:09
Extending classes in Quill to create a Timestamp Class
const Quill = require('quill');
// https://github.com/quilljs/quill/blob/develop/formats/link.js
const Link = Quill.import('formats/link');
class Timestamp extends Link {
static create(value) {
let node = super.create(value);
value = this.sanitize(value);
node.setAttribute('href', value);