Skip to content

Instantly share code, notes, and snippets.

Avatar

Nate C. nc-aura

View GitHub Profile
@nc-aura
nc-aura / gist:11d79e5c9c383538c11972fc996e8ab1
Created Feb 24, 2021 — forked from rxaviers/gist:7360908
Complete list of github markdown emoji markup
View gist:11d79e5c9c383538c11972fc996e8ab1

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:
@nc-aura
nc-aura / MyReduce.js
Last active Dec 30, 2020
my implementation of the array reduce
View MyReduce.js
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;
@nc-aura
nc-aura / simple-capistrano-docker-deploy.rb
Created Mar 19, 2019 — forked from johnbintz/simple-capistrano-docker-deploy.rb
Simple Capistrano deploy for a Docker-managed app
View simple-capistrano-docker-deploy.rb
# 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)}"
@nc-aura
nc-aura / docker-compose-node-mongo.yml
Created Oct 5, 2018 — forked from wesleybliss/docker-compose-node-mongo.yml
Docker Compose with example App & Mongo
View docker-compose-node-mongo.yml
version: '2'
services:
myapp:
build: .
container_name: "myapp"
image: debian/latest
environment:
- NODE_ENV=development
- FOO=bar
volumes:
@nc-aura
nc-aura / kmp.py
Created Jun 18, 2018
Knuth–Morris–Pratt algorithm - get the prefix table
View kmp.py
# 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)
View .color-prompt
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
@nc-aura
nc-aura / git color, and language
Created May 28, 2018
color prompt of the git status and also detect what the project is
View git color, and language
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
@nc-aura
nc-aura / ultimate-ut-cheat-sheet.md
Created Dec 15, 2017 — forked from yoavniran/ultimate-ut-cheat-sheet.md
The Ultimate Unit Testing Cheat-sheet For Mocha, Chai and Sinon
View ultimate-ut-cheat-sheet.md

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


@nc-aura
nc-aura / .bashrc
Created Jan 1, 2016
my fancy prompt for cloud9 IDE Ruby on Rails environment
View .bashrc
# ~/.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.
@nc-aura
nc-aura / Froala and Carrierwave-RoR Demo.html
Last active Apr 10, 2019
Image upload with Froala and Rails 4, Carrierwave, Fog AWS
View Froala and Carrierwave-RoR Demo.html
...
...
<textarea froala="froalaOptions"></textarea>
...
...