Skip to content

Instantly share code, notes, and snippets.

View stanleycyang's full-sized avatar
🎯
Focusing

Stanley Yang stanleycyang

🎯
Focusing
View GitHub Profile
"use strict";
const Twitter = require("twitter");
const openai = require("openai");
module.exports.improveTweets = (event, context, callback) => {
// Authenticate with the Twitter API
const client = new Twitter({
consumer_key: process.env.CONSUMER_KEY,
consumer_secret: process.env.CONSUMER_SECRET,
@stanleycyang
stanleycyang / package.json
Created October 24, 2022 02:23 — forked from kentcdodds/package.json
Validates that the versions of tools specified in `engines` in the package.json are installed on the machine.
{
"name": "workshop-computer-validator",
"version": "1.0.0",
"description": "I use this to validate people's computers have the proper versions of node and npm installed for a workshop",
"bin": "./validate-system.js",
"dependencies": {
"semver": "7.1.3"
}
}
@stanleycyang
stanleycyang / package.json
Last active October 24, 2022 04:02 — forked from kentcdodds/package.json
setup script for my workshops
{
"name": "workshop-setup",
"version": "1.0.0",
"description": "This is the common setup script for most of my workshops",
"bin": "./setup.js"
}
module.exports = {
/**
* When editing your questions pay attention to your punctuation.
* Make sure you use question marks.
* Make sure the first answer is the correct one.
* Set at least ANSWER_COUNT answers, any extras will be shuffled in.
*/
QUESTIONS_EN_US: [
{
'What snack is traditionally left out for Santa Claus?': [
@stanleycyang
stanleycyang / README-Template.md
Created June 22, 2017 00:11 — forked from PurpleBooth/README-Template.md
A template to make good README.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

function flatten(intArr, flatArr) {
var results = flatArr || [];
if (intArr && intArr.length > 0) {
intArr.forEach(function(value) {
if (typeof value === 'number') {
results.push(value);
} else if (value instanceof Array) {
flatten(value, results);
}
@stanleycyang
stanleycyang / 40install_node.sh
Last active November 5, 2016 13:32
Faster Elastic Beanstalk deployment (NodeJS 4.2.1)
#!/bin/bash
# Include envs
. /opt/elasticbeanstalk/env.vars
function error_exit
{
eventHelper.py --msg "$1" --severity ERROR
exit $2
}

#WDI Installfest (Mac)

Please check your OS X version before beginning. (Click the Apple menu and choose About this Mac.) This set of steps should work for Mavericks or Yosemite; if you're on another version, let an instructor know.

##XCode

Open up your App store and install XCode

#Writing Bash Shell Scripts

###Objectives

  • Understand what bash scripts are
  • Declare our first variable
  • Write our first bash script

###What is a shell script?

A shell script is a little more than a list of command that are run in sequence. By convention, a shell script should begin with

#Data Structures: Stacks

Objectives

  • Learn what a stack is
  • Learn what a stack overflow is
  • Overflow a stack in JS
  • Calculate a JS stack size

Variables in JavaScript (and most other programming languages) are stored in two places: stack and heap.