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 / 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)
@nnennajohn
nnennajohn / Renamefiles
Last active June 14, 2024 23:05
Rename Files Recursively Bash
for i in $(find `pwd` -name "*.t1");
do
mv "$i" "${i%.t1}.t2"
done
// Move to top
// Eg
for i in $(find `pwd` -name "*.jsx");
do
mv "$i" "${i%.jsx}.tsx"
@nnennajohn
nnennajohn / PrependFile
Created February 24, 2019 03:40
Add Flow annotations to all files in folder
// First install gnu-sed for mac. Could not get sed to work properly with new line
// brew install gnu-sed
for i in $(find `pwd` -name "*.jsx");
do
gsed -i '1i// @flow' "${i%}"
done
@nnennajohn
nnennajohn / deleteFiles
Created February 25, 2019 00:19
Delete all find ending with Path
// First list files that match to be sure
find . -name "*.spec.js" -type f
then
find . -name "*.spec.js" -type f -delete
@nnennajohn
nnennajohn / RemoveUntrackedFiles.md
Last active April 5, 2019 12:46
Remove git untracked files

When you add something into a .gitignore file, try this:

  git add [uncommitted changes you want to keep] && git commit
  git rm -r --cached .
  git add .
  git commit -m "fixed untracked files"

If you remove something from a .gitignore file, and the above steps don't work, try this:

@nnennajohn
nnennajohn / index.md
Created June 27, 2019 17:40 — forked from iamakulov/index.md
Webpack’s ContextReplacementPlugin examples
@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 / 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 / reset.ts
Last active March 15, 2020 08:20
Reset Prisma2 records
import camelCase from 'lodash/camelCase';
import { prisma } from '@cpath/universal/shared/db';
import knexClient from './knex';
// Contents of the knexClient import above
// import Knex from 'knex';
// const knexClient: Knex = Knex({
// client: 'pg',
// connection: {
// user: process.env.POSTGRES_USER,
// password: process.env.POSTGRES_PASSWORD,
@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..."