Skip to content

Instantly share code, notes, and snippets.

View MinimumViablePerson's full-sized avatar

Nicolas Marcora MinimumViablePerson

View GitHub Profile
def number_to_roman(number):
"""Convert a number between 1 and 3,999,999 to roman numerals."""
ROMAN_ONES = ['I', 'X', 'C', 'M', 'X̅', 'C̅', 'M̅']
ROMAN_FIVES = ['V', 'L', 'D', 'V̅', 'L̅', 'D̅']
conversion = ""
if not str(number).isnumeric():
return "Only numbers are allowed."
def number_to_roman(number):
"""Convert a number between 1 and 3,999,999 to roman numerals."""
ROMAN_ONES = ['I', 'X', 'C', 'M', 'X̅', 'C̅', 'M̅']
ROMAN_FIVES = ['V', 'L', 'D', 'V̅', 'L̅', 'D̅']
conversion = ""
if not str(number).isnumeric():
return "Only numbers are allowed."
class Coords(tuple):
def __new__(cls, x, y):
return tuple.__new__(cls, (x, y))
def __add__(self, other):
return Coords(*([sum(x) for x in zip(self, other)]))
def __sub__(self, other):
class Coords(tuple):
def __new__(cls, x, y):
return tuple.__new__(cls, (x, y))
def __add__(self, other):
return Coords(*([sum(x) for x in zip(self, other)]))
def __sub__(self, other):
/******** ANSWERS ********/
// ⭐: 1
const addThemAllUp = frequencyChanges => frequencyChanges.reduce((a, b) => a + b)
// ⭐: 2
const findFirstRepeatedFrequency = frequencyChanges => {
let index = 0
let currentFrequency = 0
const frequencies = new Set()
@MinimumViablePerson
MinimumViablePerson / PenPinappleApplePen.js
Last active April 14, 2019 09:01
A little AST for Jordan Scales' evaluator exercise that evaluates to `PenPinappleApplePen!`, with `Pen`, `Pinapple` and `Apple` stored in variables.
// Check out this article to write your own evaluator for it! http://thatjdanisso.cool/programming-languages/
const ppap = {
type: 'Let',
name: 'p',
value: {
type: 'String',
content: 'Pen'
},
expression: {

Being a SE Lead Instructor at Flatiron

Above all, a lead instructor is an ambassador for the [Flatiron Way][FW] and the [Flatiron Educational Principles][FEP].

The responsibilities of a Lead Instructor

Big-picture understander / Lecture giver

You have a good understanding of the Flatiron curriculum, in particular the current Module you are teaching. You are the main lecturer for the cohort and you make sure that each lecture is scaffolded and given in a way that forms an overarching story for the module.

Health checker, Pace setter

Active Record Bash Script

How to use:

  • Download the ar.sh file
  • Open your terminal where the file is
  • Run chmod +x ar.sh && mv ar.sh /usr/local/bin/ar.sh && brew install gnu-sed
  • Now you can run ar.sh [folder name] [model1] [model2] [model3...] anywhere to create a new AR project
const { keyEquals, any, hasNo, has } = require('./utils')
const itemIdEquals = keyEquals('itemId')
const isScheduledItemSuccess = collectionItem =>
any(
itemIdEquals(collectionItem._id),
hasNo('publishingError')
)
@MinimumViablePerson
MinimumViablePerson / countdown.js
Last active December 31, 2019 11:24
Recursion from Scratch - countdown with a for loop
const countdown = number => {
for (let i = number; i > 0; i--) {
console.log(i)
}
console.log('HAPPY NEW YEAR!')
}