Skip to content

Instantly share code, notes, and snippets.

View nch3ng's full-sized avatar

Nate C. nch3ng

View GitHub Profile
@nch3ng
nch3ng / jwtRS256.sh
Created November 20, 2022 23:52 — forked from ygotthilf/jwtRS256.sh
How to generate JWT RS256 key
ssh-keygen -t rsa -b 4096 -m PEM -f jwtRS256.key
# Don't add passphrase
openssl rsa -in jwtRS256.key -pubout -outform PEM -out jwtRS256.key.pub
cat jwtRS256.key
cat jwtRS256.key.pub
@nch3ng
nch3ng / gist:11d79e5c9c383538c11972fc996e8ab1
Created February 24, 2021 16:54 — forked from rxaviers/gist:7360908
Complete list of github markdown emoji markup

People

:bowtie: :bowtie: 😄 :smile: 😆 :laughing:
😊 :blush: 😃 :smiley: ☺️ :relaxed:
😏 :smirk: 😍 :heart_eyes: 😘 :kissing_heart:
😚 :kissing_closed_eyes: 😳 :flushed: 😌 :relieved:
😆 :satisfied: 😁 :grin: 😉 :wink:
😜 :stuck_out_tongue_winking_eye: 😝 :stuck_out_tongue_closed_eyes: 😀 :grinning:
😗 :kissing: 😙 :kissing_smiling_eyes: 😛 :stuck_out_tongue:
@nch3ng
nch3ng / MyReduce.js
Last active December 30, 2020 23:47
my implementation of the array reduce
Array.prototype.myReduce = function(fn, initialValue) {
let accValue = [];
let currentIndex = 0;
if (this.length === 0)
return initialValue;
accValue[currentIndex] = fn(initialValue, this[0]);
for(let i = 1; i < this.length; i++) {
accValue[i] = fn(accValue[i-1], this[i]);
currentIndex = i;
@nch3ng
nch3ng / simple-capistrano-docker-deploy.rb
Created March 19, 2019 05:05 — forked from johnbintz/simple-capistrano-docker-deploy.rb
Simple Capistrano deploy for a Docker-managed app
# be sure to comment out the require 'capistrano/deploy' line in your Capfile!
# config valid only for Capistrano 3.1
lock '3.2.1'
set :application, 'my-cool-application'
# the base docker repo reference
set :name, "johns-stuff/#{fetch(:application)}"
@nch3ng
nch3ng / docker-compose-node-mongo.yml
Created October 5, 2018 18:19 — forked from wesleybliss/docker-compose-node-mongo.yml
Docker Compose with example App & Mongo
version: '2'
services:
myapp:
build: .
container_name: "myapp"
image: debian/latest
environment:
- NODE_ENV=development
- FOO=bar
volumes:
@nch3ng
nch3ng / kmp.py
Created June 18, 2018 19:26
Knuth–Morris–Pratt algorithm - get the prefix table
# Knuth–Morris–Pratt algorithm - get the prefix table
class KMP:
def prefixTable(self, s):
table = []
table.append(0)
j = 0
for i in range(1,len(s)):
if s[i] == s[j]:
table.append(j+1)
ruby_version=`~/.rvm/bin/rvm-prompt v`
node_version=`/usr/local/bin/node -v`
NONE="\[\033[0m\]" # unsets color to term's fg color
# regular colors
K="\[\033[0;30m\]" # black
R="\[\033[0;31m\]" # red
G="\[\033[0;32m\]" # green
Y="\[\033[0;33m\]" # yellow
@nch3ng
nch3ng / git color, and language
Created May 28, 2018 21:18
color prompt of the git status and also detect what the project is
ruby_version=`~/.rvm/bin/rvm-prompt v`
node_version=`/usr/local/bin/node -v`
NONE="\[\033[0m\]" # unsets color to term's fg color
# regular colors
K="\[\033[0;30m\]" # black
R="\[\033[0;31m\]" # red
G="\[\033[0;32m\]" # green
Y="\[\033[0;33m\]" # yellow
@nch3ng
nch3ng / ultimate-ut-cheat-sheet.md
Created December 15, 2017 04:47 — forked from yoavniran/ultimate-ut-cheat-sheet.md
The Ultimate Unit Testing Cheat-sheet For Mocha, Chai and Sinon

The Ultimate Unit Testing Cheat-sheet

For Mocha, Chai and Sinon

using mocha/chai/sinon for node.js unit-tests? check out my utility: mocha-stirrer to easily reuse test components and mock require dependencies


@nch3ng
nch3ng / .bashrc
Created January 1, 2016 21:24
my fancy prompt for cloud9 IDE Ruby on Rails environment
# ~/.bashrc: executed by bash(1) for non-login shells.
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
# for examples
. /etc/apache2/envvars
# If not running interactively, don't do anything else
[ -z "$PS1" ] && return
# don't put duplicate lines or lines starting with space in the history.