Skip to content

Instantly share code, notes, and snippets.

View nnennajohn's full-sized avatar

Nnenna John nnennajohn

  • San Francisco, CA
View GitHub Profile
@nnennajohn
nnennajohn / generate-md-files.js
Created October 7, 2020 01:29 — forked from DavidWells/generate-md-files.js
Generate markdown files with faker.js
var faker = require('faker')
var fs = require('fs')
var path = require('path')
for (var i = 0; i < 1000; i++) {
generateMD()
}
function generateMD () {
var fileName = faker.lorem.word() + '-' + faker.lorem.word()
@nnennajohn
nnennajohn / nvmCommands.js
Last active August 1, 2020 01:31 — forked from chranderson/nvmCommands.js
Useful NVM commands
// check version
node -v || node --version
// list installed versions of node (via nvm)
nvm ls
// install specific version of node
nvm install 6.9.2
// set default version of node
@nnennajohn
nnennajohn / notion2blog.js
Created April 14, 2020 22:10 — forked from mayneyao/notion2blog.js
Notion.so > Personal Blog | custom domain + disqus comment
const MY_DOMAIN = "agodrich.com"
const START_PAGE = "https://www.notion.so/gatsby-starter-notion-2c5e3d685aa341088d4cd8daca52fcc2"
const DISQUS_SHORTNAME = "agodrich"
addEventListener('fetch', event => {
event.respondWith(fetchAndApply(event.request))
})
const corsHeaders = {
"Access-Control-Allow-Origin": "*",
@nnennajohn
nnennajohn / Update .gitignore
Created March 29, 2020 20:39 — forked from c33k/Update .gitignore
Updating .gitignore and cleaning the cache
//First commit any outstanding code changes, and then, run this command:
git rm -r --cached .
//This removes any changed files from the index(staging area), then just run:
git add .
//Commit
git commit -m "Atualizando .gitignore para..."
@nnennajohn
nnennajohn / download.js
Created August 3, 2019 10:56 — forked from gregbarcza/download.js
Download all image from cloudinary
'use strict'
const cloudinary = require('cloudinary')
const Promise = require('bluebird')
const co = require('co')
const fs = Promise.promisifyAll(require('fs'))
const request = require('request')
const moment = require('moment')
// FILL THIS
cloudinary.config({
cloud_name: '',
@nnennajohn
nnennajohn / eventemitter.js
Created July 9, 2019 22:55 — forked from mudge/eventemitter.js
A very simple EventEmitter in pure JavaScript (suitable for both node.js and browsers).
/* Polyfill indexOf. */
var indexOf;
if (typeof Array.prototype.indexOf === 'function') {
indexOf = function (haystack, needle) {
return haystack.indexOf(needle);
};
} else {
indexOf = function (haystack, needle) {
var i = 0, length = haystack.length, idx = -1, found = false;
@nnennajohn
nnennajohn / index.md
Created June 27, 2019 17:40 — forked from iamakulov/index.md
Webpack’s ContextReplacementPlugin examples
@nnennajohn
nnennajohn / gist:fefa33b5853ab7f5ec2827e25dd64070
Last active April 30, 2018 16:37 — forked from weblancaster/gist:6e7f43fc02725ce747e224b0c4290906
Kill all container, remove all images and stop all containers && Extras
## DOCKER
#stop all containers:
docker kill $(docker ps -q)
#remove all containers
docker rm $(docker ps -a -q)
#remove all docker images
docker rmi $(docker images -q)