Skip to content

Instantly share code, notes, and snippets.

@learnwell
learnwell / sample1.tex
Last active May 28, 2019
latex cheat sheet index card
View sample1.tex
%% Setup to use an index card
\documentclass[10pt]{book}
\usepackage[vcentering,dvips]{geometry}
\geometry{papersize={3in,5in},total={2.9in,4.9in}}
%% render a frame marking the margins of a document
% \usepackage{showframe}
%% show landscape view
\usepackage{pdflscape}
@learnwell
learnwell / gist:91ccbe15b7c874f4048e75a58e2522f5
Created Apr 5, 2019
pdfkit - add page numbers in footer while new pages are added automatically
View gist:91ccbe15b7c874f4048e75a58e2522f5
// create a document and pipe to a blob
var doc = new PDFDocument();
var stream = doc.pipe(blobStream());
doc.text('MY COVER PAGE');
doc.text('i will not add a page number in the footer here');
doc.text('please scroll down to see other pages');
doc.text('they do have page numbers starting with 1');
function footer(counter) {
View gist:96a21c7f9b30aeb878c5cbd39971c98f
// https://pdfkit.org/demo/browser.html
// create a document and pipe to a blob
var doc = new PDFDocument();
var stream = doc.pipe(blobStream());
doc.text('hello');
doc.text(lorem, {
columns: 3,
@learnwell
learnwell / bootstrap-grid-view.html
Created Mar 23, 2019
Working "Grid-View" example with bootstrap layout and cards
View bootstrap-grid-view.html
<div class="container">
<div class="row">
<div class="col-4 bg-secondary">
.row &gt; .col-xs-4
</div>
<div class="col-4 bg-primary">
.row &gt; .col-xs-4
this is
a much
taller
@learnwell
learnwell / README.MD
Created Mar 2, 2019
Use filter() method to check if an array of object includes what we seek
View README.MD

GOAL

Use filter() method to check if an array of object includes what we seek via TypeScript Sandbox online: https://typescript-play.js.org/#code/Q

// testing how the out-of-box `filter` for ES6 ecma works without utilities like lodash
// https://typescript-play.js.org/#code/Q
let knownFiles = [
    { file: 'xxx', status: 0 },
@learnwell
learnwell / gist:671a1d3817db7b66a9bc8b108ad50ac9
Created Nov 27, 2018
CH8 Problem 22 - Rotational Motion
View gist:671a1d3817db7b66a9bc8b108ad50ac9
A uniform disk turns at 2.4 rev/s around a frinctionless spindle. A nonrotating rod, of the
same mass as the disk and length equal to the disk's diameter, is dropped onto the freely
spinning disk. They then both turn around the spindle with their centers superposed. What is
the angular frequency in rev/s of the combination?
@learnwell
learnwell / README.md
Last active Oct 30, 2018
docker-compose template for using nodejs within a docker image without installing it on the host OS
View README.md

Goal(s)

  • Use nodejs without installing it on the host OS
  • Use docker-compose to accomplish this

Step(s)

  1. On your local/remote machine:
    curl https://gist.githubusercontent.com/learnwell/953aa51d2322dad484178f3738513c71/raw/docker-compose.yml > docker-compose.yml`
    
@learnwell
learnwell / bio-ch5.mermaid
Created Sep 25, 2018
bio101 chapter5 mermaid diagram
View bio-ch5.mermaid
graph TD
1[PLAN-C]
1--> 1a[Proteins]
1--> 1b[Lipids]
1--> 1c[Nucleic Acids]
1--> 1d[Carbohydrates]
1a --> |monomer ?| 1a2[NH2 + COOH + C + H + R-amino-acid-side-group]
You can’t perform that action at this time.