Skip to content

Instantly share code, notes, and snippets.

View code-for-coffee's full-sized avatar

James code-for-coffee

  • Chicago, IL
View GitHub Profile
@code-for-coffee
code-for-coffee / hsk1-words-dataset.json
Created August 30, 2020 01:48
HSK 1 Word Prep Dataset
{
"Personal Pronouns": [
{ "Hàn Zì": "我", "Pinyin": "wǒ", "English": "I, me" },
{ "Hàn Zì": "我们", "Pinyin": "wǒmen", "English": "we, us (pl.)" },
{ "Hàn Zì": "你", "Pinyin": "nǐ", "English": "you" },
{ "Hàn Zì": "你们", "Pinyin": "nǐmen", "English": "you (pl.)" },
{ "Hàn Zì": "他", "Pinyin": "tā", "English": "he, him" },
{ "Hàn Zì": "她", "Pinyin": "tā", "English": "she, her" },
{
"Hàn Zì": "他们",
@code-for-coffee
code-for-coffee / keybase.md
Created January 30, 2018 19:44
keybase.md

Keybase proof

I hereby claim:

  • I am code-for-coffee on github.
  • I am codeforcoffee (https://keybase.io/codeforcoffee) on keybase.
  • I have a public key ASBsXI2tUc1uUwMrDbn9MW0-6X_9d7ihX7GdN5zlnp7i0wo

To claim this, I am signing this object:

@code-for-coffee
code-for-coffee / slides.md
Last active June 18, 2017 22:12
FEWD Butterfree Day 1

GeneralAssemb.ly

FEWD - HTML BASICS

Katie Allyn

Assistant Instructor

@code-for-coffee
code-for-coffee / categoryCounter.js
Created November 3, 2016 02:10
CategoryCounter
const json = require('./data.json');
let counter = 0;
for (var i = 0; i < json.length; i++) {
let planet = json[i];
let mass = planet['pl_bmassj'];
if (mass > 0) {
counter++;
}
}
console.log(`There are ${json.length} items and only ${counter} have logged masses.`);
@code-for-coffee
code-for-coffee / massTest.js
Last active November 3, 2016 02:05
massTest
const json = require('./data.json');
const MAX_INT = Number.MAX_SAFE_INTEGER;
let WARNING_TRIGGER = false;
for (var i = 0; i < json.length; i++) {
let planet = json[i];
let mass = planet['pl_bmassj'];
if (mass && mass >= MAX_INT) {
WARNING_TRIGGER = true;
}
console.log(planet['rowid'] + ' ' + mass);
@code-for-coffee
code-for-coffee / PlanetTypesCollection.js
Last active November 3, 2016 01:23
PlanetTypesCollection
let PlanetTypesCollection = {
Asteroidan: {
minMass: 0,
maxMass: 0.00001,
desc: 'Asteroidans are small irregular bodies (below the hydrostatic equilibrium) that are not able to hold a stable atmosphere.'
},
Mercurian: {
minMass: 0.00011,
maxMass: 0.1,
desc: 'Mercurians are only able to hold a significant atmospheres in the cold zones beyond the snow line (i.e. Titan).'
@code-for-coffee
code-for-coffee / PlanetTypes.json
Created November 3, 2016 01:21
PlanetTypes.json
[{
"name": "Asteroidan",
"minMass": 0,
"maxMass": 0.00001,
"desc": "Asteroidans are small irregular bodies (below the hydrostatic equilibrium) that are not able to hold a stable atmosphere."
}, {
"name": "Mercurian",
"minMass": 0.00011,
"maxMass": 0.1,
"desc": "Mercurians are only able to hold a significant atmospheres in the cold zones beyond the snow line (i.e. Titan)."
@code-for-coffee
code-for-coffee / exoplanets.json
Created November 3, 2016 01:10
Exoplanet Output JSON (11/2/16)
This file has been truncated, but you can view the full file.
[{"rowid":1,"pl_hostname":"11 Com","pl_letter":"b","pl_pnum":1,"pl_orbper":326.03,"pl_orbpererr1":0.32,"pl_orbpererr2":-0.32,"pl_orbperlim":0,"pl_bmassj":19.4,"pl_bmassjerr1":1.5,"pl_bmassjerr2":-1.5,"pl_bmassjlim":0,"pl_radj":"","pl_radjerr1":"","pl_radjerr2":"","pl_radjlim":""},{"rowid":2,"pl_hostname":"11 UMi","pl_letter":"b","pl_pnum":1,"pl_orbper":516.22,"pl_orbpererr1":3.25,"pl_orbpererr2":-3.25,"pl_orbperlim":0,"pl_bmassj":10.5,"pl_bmassjerr1":2.47,"pl_bmassjerr2":-2.47,"pl_bmassjlim":0,"pl_radj":"","pl_radjerr1":"","pl_radjerr2":"","pl_radjlim":""},{"rowid":3,"pl_hostname":"14 And","pl_letter":"b","pl_pnum":1,"pl_orbper":185.84,"pl_orbpererr1":0.23,"pl_orbpererr2":-0.23,"pl_orbperlim":0,"pl_bmassj":4.8,"pl_bmassjerr1":"","pl_bmassjerr2":"","pl_bmassjlim":0,"pl_radj":"","pl_radjerr1":"","pl_radjerr2":"","pl_radjlim":""},{"rowid":4,"pl_hostname":"14 Her","pl_letter":"b","pl_pnum":1,"pl_orbper":1773.4,"pl_orbpererr1":2.5,"pl_orbpererr2":-2.5,"pl_orbperlim":0,"pl_bmassj":4.64,"pl_bmassjerr1":0.19,"pl_bmas
rowid pl_hostname pl_letter pl_pnum pl_orbper pl_orbpererr1 pl_orbpererr2 pl_orbperlim pl_bmassj pl_bmassjerr1 pl_bmassjerr2 pl_bmassjlim pl_radj pl_radjerr1 pl_radjerr2 pl_radjlim
1 11 Com b 1 326.03000000 0.32000000 -0.32000000 0 19.40000 1.50000 -1.50000 0
2 11 UMi b 1 516.22000000 3.25000000 -3.25000000 0 10.50000 2.47000 -2.47000 0
3 14 And b 1 185.84000000 0.23000000 -0.23000000 0 4.80000 0
4 14 Her b 1 1773.40000000 2.50000000 -2.50000000 0 4.64000 0.19000 -0.19000 0
5 16 Cyg B b 1 798.50000000 1.00000000 -1.00000000 0 1.68000 0.15000 -0.15000 0
6 18 Del b 1 993.30000000 3.20000000 -3.20000000 0 10.30000 0
7 1RXS J160929.1-210524 b 1 8.00000 1.00000 -1.00000 0
8 24 Sex b 2 452.80000000 2.10000000 -4.50000000 0 1.99000 0.26000 -0.38000 0
9 24 Sex c 2 883.00000000 32.40000000 -13.80000000 0 0.86000 0.35000 -0.22000 0
@code-for-coffee
code-for-coffee / CSVObjectifier.js
Last active November 3, 2016 01:16
ExoplanetClass
/**
* Created by codeforcoffee on 11/2/16.
*/
const Converter = require("csvtojson").Converter;
const fs = require('fs');
const path = require('path');
class CSVObectifier {
constructor(csvFileData) {
this.converter = new Converter({});