Skip to content

Instantly share code, notes, and snippets.

View andrewsadowski's full-sized avatar

Andrew Sadowski andrewsadowski

  • DevelopmentNow
  • Portland, Oregon
View GitHub Profile
@andrewsadowski
andrewsadowski / babun-Hyper-Win.md
Created December 23, 2018 03:12 — forked from silo/babun-Hyper-Win.md
Babun + Hyper + Windows - Setup

Recursively Remove all Node Modules folders from hard drive

Open up the good ole' command line & run:

find . -name "node_modules" -exec rm -rf '{}' +
const fs = require("fs");
const argv = require("yargs")
.alias("p", "path")
.usage("Usage: add path with the -p flag")
.example('node renamer.js -p "./pathToFilesToRename"')
.help("h").argv;
let PATH;
if (argv === "p") {
var db = require("diskdb");
var fetch = require("node-fetch");
db = db.connect(
"./db",
["fetchData"]
);
async function fetchData() {
const url1 = "https://www.google.com";
@andrewsadowski
andrewsadowski / LinkedList.js
Created June 24, 2018 01:19
JS implementation of a LinkedList
class Node {
constructor(data, next = null) {
this.data = data;
this.next = next;
}
}
class LinkedList {
constructor() {
@andrewsadowski
andrewsadowski / regex_subtitle.md
Last active November 13, 2018 21:04
Regular Expressions for targeting subtitle (srt) elements

Regular Expressions for Subtitles (For SRT)

Timing Elements

Subtitle Index Number:

/^[0-9]{1,}\n/gm

Subtitle Index and Timestamps:

@andrewsadowski
andrewsadowski / gulpfile.js
Created April 16, 2018 01:53
Gulp script that handles UTF-8 BOM encoding and changes file-extensions of a given type
const gulp = require('gulp');
const bom = require('gulp-bom');
var ext_replace = require('gulp-ext-replace');
gulp.task('bom-ify', () => {
gulp
.src('./test-files/*.srt')
.pipe(bom())
.pipe(gulp.dest('dist'));
});
@andrewsadowski
andrewsadowski / ReadMultipleFiles.js
Created March 11, 2018 07:53
ReadMultipleFiles-NodeJS
var fs = require('fs'),
async = require('async'),
readMultipleFiles = require('read-multiple-files');
var dirPath = 'sample_files/';
//------------------------------------------------------
//fs module to read multiple files using async
//Web Link=>
//------------------------------------------------------
@andrewsadowski
andrewsadowski / fakerData.py
Last active February 14, 2018 22:16
Short Python script to generate fake addresses, names and email addresses with Faker.py
from faker import Faker
fake = Faker('es_ES')
for _ in range(10):
print(fake.address())
for _ in range(30):
print(fake.name())