Skip to content

Instantly share code, notes, and snippets.

View kenyipp's full-sized avatar

Ken Yip kenyipp

View GitHub Profile
@diogocapela
diogocapela / moment-js-timezones.txt
Created September 7, 2018 00:10
List of All Moment.js Timezones
Africa/Abidjan
Africa/Accra
Africa/Addis_Ababa
Africa/Algiers
Africa/Asmara
Africa/Asmera
Africa/Bamako
Africa/Bangui
Africa/Banjul
Africa/Bissau
@NigelEarle
NigelEarle / Knex-Migrations-Seeding.md
Last active September 12, 2024 21:32
Migration and seeding instructions using Knex.js!

Migrations & Seeding

What are migrations??

Migrations are a way to make database changes or updates, like creating or dropping tables, as well as updating a table with new columns with constraints via generated scripts. We can build these scripts via the command line using knex command line tool.

To learn more about migrations, check out this article on the different types of database migrations!

Creating/Dropping Tables

@NigelEarle
NigelEarle / Knex-Setup.md
Last active September 12, 2024 21:32
Setup Knex with Node.js

Knex Setup Guide

Create your project directory

Create and initialize your a directory for your Express application.

$ mkdir node-knex-demo
$ cd node-knex-demo
$ npm init
@cyberwombat
cyberwombat / api.js
Created November 13, 2016 23:28
Walmart API authentication in Node
import { createSign, randomBytes } from 'crypto'
import axios from 'axios'
import { resolve } from 'url'
const PK_HEADER = '\n-----BEGIN PRIVATE KEY-----\n'
const PK_FOOTER = '\n-----END PRIVATE KEY-----\n'
const BASE_URL = 'https://marketplace.walmartapis.com/'
const WALMART_CONSUMER = "b68d2a72....";
@stephenhardy
stephenhardy / git-clearHistory
Created April 26, 2013 22:14
Steps to clear out the history of a git/github repository
-- Remove the history from
rm -rf .git
-- recreate the repos from the current content only
git init
git add .
git commit -m "Initial commit"
-- push to the github remote repos ensuring you overwrite history
git remote add origin git@github.com:<YOUR ACCOUNT>/<YOUR REPOS>.git