Skip to content

Instantly share code, notes, and snippets.

Avatar

Cyd La Luz quetzaluz

  • Seattle, Washington
View GitHub Profile
View setup-readme.md

The following is a sample of a readme Setup section for a node postgres stack:

Setup

  • Clone this repository to your local machine
  • Install the dependencies for the project
  • Ensure your PostgreSQL server is running
  • Create a User for this exercise
  • Create a database for the exercise with your user as the owner
  • Copy [do not rename] the example.env file as .env and update .env with the following fields with your database credentials:
View example.env
NODE_ENV=development
PORT=8000
MIGRATION_DB_HOST=localhost
MIGRATION_DB_PORT=5432
MIGRATION_DB_NAME=
MIGRATION_DB_USER=
MIGRATION_DB_PASS=
DB_URL="postgresql://USERNAME@localhost/DATABASE_NAME"
@quetzaluz
quetzaluz / gist:d4aff69ca81b43d4eb9780d89e7794fc
Last active Aug 26, 2020
Notes on status codes for my students
View gist:d4aff69ca81b43d4eb9780d89e7794fc

Core status codes -- can look at as a checklist when building API

View instructions.md

Back to School Shopping Live Interview problems

Welcome to the live interview! We'll be taking this problem set and working on a few additional problems.

Prompt 1 - Find Items

You want to know which items are of the same type. Create a function called findItems that takes the array of items and a type of item as parameters and returns an array of item names.

View task.md

Interview: Science Questions

You will be writing one additional function to help analyze responses for a science quiz. You will then add a feature onto that function. Your interview will help guide you through this process. As a reminder, each response is represented as an object with the following keys:

  • question - the question that was asked, represented as a string.
  • response - the response that was given, represented as a string.
  • correct - whether or not the response was graded as correct, represented as a boolean.
  • isEssayQuestion - whether or not the response is an essay question, represented as a boolean.

Data for the entire month is stored in an array. For example:

@quetzaluz
quetzaluz / sample-nps-nlp-model.py
Created Oct 11, 2018
Example of predicting NPS score from feedback comments, also means of bucketizing customer sentiment.
View sample-nps-nlp-model.py
import os
import pandas as pd
from sklearn.model_selection import train_test_split
import nltk
from nltk.corpus import stopwords
from nltk.tokenize import RegexpTokenizer
import time
@quetzaluz
quetzaluz / jest-spy-generator.js
Created Oct 9, 2018
Method for quickly generating jest spy boilerplate given a list of stringified module dot class
View jest-spy-generator.js
function generateSpyFromMethod (mthdList) {
const top = []
const bottom = []
mthdList.forEach(function (mthd) {
const spl = mthd.split('.')
let first = spl[0]
let last = spl[1]
first = first[0].toLowerCase() + first.slice(1)
last = last[0].toUpperCase() + last.slice(1)
const spyVar = `${first}${last}Spy`
View gist:3869f249de4bf76838d7
// Obviously versions will change.
// Reference for how to set up a headless scraper on EC2
sudo apt-get update
sudo apt-get -y install openjdk-7-jre-headless
sudo apt-get -y install xvfb
sudo apt-get -y install xserver-xorg-core
sudo apt-get -y install xfonts-100dpi xfonts-75dpi xfonts-scalable xfonts-cyrillic
wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | sudo apt-key add -
sudo sh -c 'echo "deb http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google.list'
sudo apt-get update
View howto.md

Building A New File Based Data Connector/Processor

In order to process files of a new type, such as a new type of test we've never processed before, you'll have to define how to process that file within this module. Here are some steps that may help you accomplish this. The majority of this work will occur in the file ~/SzfdData/config/module.config.php and other areas of the SzfdData module.

It is a prerequisite that you have access to our szf code repository to perform these steps. Please get in touch with Jake Alves or another lead engineer to get access to this code repo.

1: Create a schema file by looking at the file you are trying to upload

Some academic tests contain help documentation for the test reports they issue, and some tests do not provide such documentation. Here is an example of the California State Test's documentation for their testing reports.

View CORS ex
module.exports = {
"access-control-allow-origin": "*",
"access-control-allow-methods": "GET, POST, PUT, DELETE, OPTIONS",
"access-control-allow-headers": "Origin, X-Requested-With, Content-Type, Accept, X-Parse-Application-Id, X-Parse-REST-API-Key",
"access-control-max-age": 10 // Seconds.
};