Skip to content

Instantly share code, notes, and snippets.

View coreycoburn's full-sized avatar

Corey Coburn coreycoburn

View GitHub Profile
@coreycoburn
coreycoburn / gist:27c290f6cc50227d9c2162f9eca6ff41
Created November 17, 2018 19:17
Create Multiple databases in Docker Compose
entrypoint:
sh -c "
echo 'CREATE DATABASE IF NOT EXISTS dbname;' > /docker-entrypoint-initdb.d/init.sql;
/usr/local/bin/docker-entrypoint.sh --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci"
@coreycoburn
coreycoburn / DynamicComponent.vue
Last active October 26, 2022 08:54
Dynamically load Vue components
<template>
<div>
<component :is="dynamicComponent"/>
</div>
<template>
<script>
export default {
props: {
componentName: {
@coreycoburn
coreycoburn / reversedString.js
Last active May 18, 2020 03:01
Coding Challenges Data Structures and Algorithms
// Reverse a string
// O(n) linear time
const reversePhrase = phrase => {
phrase = phrase.split('')
const halfPhrase = Math.floor(phrase.length / 2)
const length = phrase.length - 1
for (i=0; i < halfPhrase; i++) {
let front = phrase[i]
@coreycoburn
coreycoburn / .eslintrc.js
Last active June 8, 2020 20:10
Eslint config for React
module.exports = {
extends: ['airbnb', 'plugin:prettier/recommended', 'prettier/react'],
parser: 'babel-eslint',
parserOptions: {
ecmaVersion: 2020,
// Can I remove these now?
ecmaFeatures: {
impliedStrict: true,
classes: true,
},
@coreycoburn
coreycoburn / .prettierrc.js
Last active June 5, 2020 15:01
Prettier config
module.exports = {
trailingComma: 'es5',
tabWidth: 2,
semi: true,
singleQuote: true,
arrowParens: 'avoid',
}
@coreycoburn
coreycoburn / .editorconfig
Created June 3, 2020 02:00
Editor config dotfile
root = true
[*]
indent_style = space
indent_size = 2
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
end_of_line = lf
max_line_length = off
module.exports = {
plugins: [require('tailwindcss'), require('autoprefixer')],
};