Skip to content

Instantly share code, notes, and snippets.

View jeffjohnson9046's full-sized avatar

Jefe Johnson jeffjohnson9046

View GitHub Profile
CREATE USER [database owner name] WITH CREATEROLE ENCRYTPED PASSWORD '[database owner's password]';
CREATE DATABASE [database name] OWNER [database owner name];
-- connect to [database name]
REVOKE CREATE ON SCHEMA public FROM PUBLIC;
REVOKE ALL ON DATABASE [database name] FROM PUBLIC;
REVOKE ALL ON ALL TABLES IN SCHEMA public FROM PUBLIC;
-- log in as [database owner name] to [database name] db
CREATE SCHEMA [schema name];
@jeffjohnson9046
jeffjohnson9046 / .vimrc
Created July 1, 2021 14:09
My vim settings
set laststatus=2
set nu
syntax on
set statusline= " clear the statusline for when vimrc is reloaded
set statusline+=%-3.3n\ " buffer number
set statusline+=%f\ " file name
set statusline+=%h%m%r%w " flags
set statusline+=[%{strlen(&ft)?&ft:'none'}, " filetype
set statusline+=%{strlen(&fenc)?&fenc:&enc}, " encoding
/******************************************************************************************************************************
I was watching a video of a guy reading an article (man... what fucking strange times we live in...) about developers missing
basic programming skills because they rely on npm packages to do the work for them. There are packages like left-pad, is-array,
is-positive-integer, etc. Apparently some change in the left-pad package broke a bunch of big-time repos (including React).
This is a link to said video: https://www.youtube.com/watch?v=NmHUjxKpD90
My main take-aways from the article/video were:
* just because it's a package that gets downloaded a bunch of times doesn't mean it's good, quality code
* don't introduce a dependency if you don't need to
* an over-reliance on external dependencies:
@jeffjohnson9046
jeffjohnson9046 / tasks.json
Created September 25, 2023 16:13
A tasks.json file for compiling a simple C++ application in VS Code
/* Been going through the Learn C++ tutorial (https://www.learncpp.com/), and so far this seems to be a pretty good setup for
tasks.json in VS Code. This tasks.json file is specific for clang++ (I'm on macOS 13.x), so you may need to update the `args`
to suit your own environment. In particular, you will want to replace with {your application name here} with whatever you want
your build artifact to be named.
*/
{
"tasks": [
{
"type": "cppbuild",
"label": "C/C++: clang++ build active file",
@jeffjohnson9046
jeffjohnson9046 / fizzbuzz.js
Created September 28, 2023 14:01
The classic Fizz Buzz but without using the if...else if... else solution
const fizzBuzzMap = {
3: 'Fizz',
5: 'Buzz',
15: 'FizzBuzz'
};
/**
* The classic "Fizz Buzz" game: Print a list of numbers from 1 to the upper limit, using the following rules:
* * If the number is divisible by 3 print "Fizz"
* * If the number is divisible by 5 print "Buzz"