Skip to content

Instantly share code, notes, and snippets.

View ursulacj's full-sized avatar
😷

Ursula CJ ursulacj

😷
View GitHub Profile
@ursulacj
ursulacj / Create-branch-with-Github-API.md
Last active June 26, 2024 17:23 — forked from auwsome/Create-branch-with-Github-API.md
Create a branch on Github using API and Python

Create a branch on Github using API and Python

Created as a module that can be imported or run. Requires built in JSON, requests, and datetime modules.

Allows you to clone a branch on Github using the Github Git Database API Endpoints.

Forked Gist from:

  • auwsome/Create-branch-with-Github-API.md

See:

@ursulacj
ursulacj / lambda-not-anon.md
Created April 13, 2019 19:23
The distinction between anonymous functions and lambdas in JavaScript.

TL;DR - Lambda means "function used as data".

Anonymous function means "function without a name".

This is one of the relatively few cases where the Wikipedia definition of a word, while not entirely wrong, is misleading. Lambdas and anonymous functions are distinct ideas.

These ideas are commonly confused because in many programming languages (and lambda calculus) all lambdas are anonymous or vise verse.

In JavaScript, not all lambdas are anonymous, and not all anonymous functions are lambdas, so the distinction has some practical meaning.

Guide to Add a Feature to a Web App

Intro

This guide is generic in that it does pertain to any particular web framework, e.g., Express.

When the time comes to implement a user story (feature) in a typical web application, following the steps below usually is a good approach to take in most cases...

Perform CRUD Using Mongoose Models in a Node REPL

  1. Start by opening a terminal session and make sure that you are in the project's root folder.

  2. Start a Node REPL:

    $ node
    > 

RESTful Routing for
Related (Nested) Data Relationships

Scenario

A Post has many Comments

RESTful Routes for Performing CUD Data Operations on Comments:

HTTP Verb Path (endpoint) controller#action Purpose

Resourceful Routing for CRUD Operations in Web Applications

Note: The RESTful routes also apply to RESTful APIs, however JSON is returned to the client vs. HTML

RESTful Routes:

HTTP Verb Path (endpoint) controller#action View to Render
or Redirect
Purpose
GET /posts posts#index index List all posts
GET /posts/:id posts#show show Show a single post
@ursulacj
ursulacj / vanilla-js-cheatsheet.md
Created January 26, 2019 19:09 — forked from thegitfather/vanilla-js-cheatsheet.md
Vanilla JavaScript Quick Reference / Cheatsheet