Skip to content

Instantly share code, notes, and snippets.

View de314's full-sized avatar

David Esposito de314

  • BetterCloud
  • Atlanta
View GitHub Profile
@de314
de314 / .zshrc
Last active April 17, 2020 20:16
# Start with
# - https://medium.com/swlh/power-up-your-terminal-using-oh-my-zsh-iterm2-c5a03f73a9fb
# $ brew install zsh-autosuggestions
# $ brew install zsh-syntax-highlighting
# - https://sourabhbajaj.com/mac-setup/iTerm/zsh.html
# - https://github.com/AdoptOpenJDK/homebrew-openjdk
# - https://apple.stackexchange.com/a/293988
export TERM="xterm-256color"
switch (action.type) {
// ...
case 'CHECK_PASSWORD': {
// the following should probably be configurable settings
// v v v v v v v v v v
const minPasswordLength = 8
const maxPasswordLength = 30
const pwRegSpecial = /[_:!#$%=+<>-]/
const pwBadChars = /[^\w:!#$%=+<>-]/
const pwRegLower = /[a-z]/
@de314
de314 / package.json
Created December 30, 2017 16:07
Browser Sync
{
"name": "demo",
"version": "0.0.1",
"description": "",
"main": "index.js",
"scripts": {
"start": "browser-sync start --server --files '*.css, *.html, *.js'"
},
"keywords": [],
"author": "",
# Your init script
#
# Atom will evaluate this file each time a new window is opened. It is run
# after packages are loaded/activated and after the previous editor state
# has been restored.
#
# An example hack to log to the console when each text editor is saved.
#
# atom.workspace.observeTextEditors (editor) ->
# editor.onDidSave ->
@de314
de314 / bbs.sh
Created January 13, 2018 03:12
Start script for browser sync
#!/bin/bash
# You need to globally install broswser-sync `npm i -g browser-sync` and might need to export the node path
# Then you can run `$ bbs` to serve the current directory or `bbs ~/workspace/web/my-project` to specify the base directory
SERVER_DIR=${1:-$PWD}
echo $SERVER_DIR
browser-sync start -s $SERVER_DIR -f $SERVER_DIR --port 3333 --ui-port 3334 --directory --cors

We start with the dictionary: { a, ab, bc, aab, aac, bd, ca }

And the Search String: bcaab

1. Build the Trie

Following the steps in the first video you should end up with

trie

function test() { return 'Hello, World!' }
function fromFunc(func) { return func.toString() }
function toFunc(funcString) { return new Function(`return ${funcString.toString()}`)() }
let tmp = fromFunc(test)
// tmp = "function test() { console.log('Hello, World!') }"
tmp = toFunc(tmp)
@de314
de314 / adminBro.js
Created February 26, 2019 16:01
Admin Bro + FeathersJS
// Admin Bro
const AdminBro = require('admin-bro');
const AdminBroExpressjs = require('admin-bro-expressjs');
const logger = require('./logger');
AdminBro.registerAdapter(require('admin-bro-mongoose'));
module.exports = function(app) {
const adminBroSettings = app.get('adminBro');
const adminBroRootPath =
import React from 'react';
import { Field } from 'formik';
import AceEditor from 'react-ace';
import 'brace/mode/ejs';
import 'brace/theme/textmate';
export const EjsForm = ({ name }) => (
<Field name={name}>
const express = require("@runkit/runkit/express-endpoint/1.0.0");
const jsonServer = require('json-server')
const axios = require('axios')
const app = express(exports);
async function addDataSource(data, url) {
const res = await axios.get(url);
Object.assign(data, res.data)
}