Skip to content

Instantly share code, notes, and snippets.

View pertrai1's full-sized avatar
🏠
Working from home

Rob Simpson pertrai1

🏠
Working from home
  • Warrenton, VA
View GitHub Profile
@pertrai1
pertrai1 / array-prototype.js
Created November 20, 2024 15:42
JS Array Prototype - Interview Question
/**
* Without calling Array.prototype.map(), Array.prototype.filter(), Array.prototype.reduce(), or
* Array.prototype.forEach(), implement the following three similar functions on the Array prototype:
*/
/*
* myMap(callback)
* Without mutating the original array, this function should call the passed callback function on every
* element of the array and return a new array containing the result of all these calls, in the corresponding order.
* The callback function can take up to three parameters:
@pertrai1
pertrai1 / robot-emoji.css
Created November 16, 2024 00:53
Robot Emoji
:root {
--head-bg: #a4d9eb;
--head-bdr-clr: #9bbcc2;
--bulb-bg: #ffa500;
--stick-bg: #808080;
--ear-bg: #c90a0a;
--eye-bg: #fff;
--eye-bdr-clr: #00b3ff;
--nose-bg: #c90a0a;
--mouth-bg: #dedede;
@pertrai1
pertrai1 / actionlist.vim
Created March 10, 2024 23:32 — forked from zchee/actionlist.vim
IdeaVim actionlist
--- Actions ---
$Copy <M-C>
$Cut <M-X> <S-Del>
$Delete <Del> <BS> <M-BS>
$LRU
$Paste <M-V>
$Redo <M-S-Z> <A-S-BS>
$SearchWeb <A-S-G>
$SelectAll <M-A>
$Undo <M-Z>
// Variable to store the previous bounds
let previousBounds = null;
// Event listener for the 'moveend' event of the map
map.on('moveend', () => {
const currentBounds = map.getBounds();
// Check if there are previous bounds
if (previousBounds) {
const distance = getDistance(previousBounds, currentBounds);
@pertrai1
pertrai1 / back.html
Created September 9, 2022 14:26
Back Top
<a id="back-to-top"
class="scroll-top scroll-top-link">
<i class="fa fa-arrow-circle-up"></i>
</a>

We've installed your MySQL database without a root password. To secure it run: mysql_secure_installation

MySQL is configured to only allow connections from localhost by default

To connect run: mysql -uroot

To restart mysql after an upgrade: brew services restart mysql

@pertrai1
pertrai1 / .zshrc
Created June 12, 2022 16:03
zshrc
# Enable Powerlevel10k instant prompt. Should stay close to the top of ~/.zshrc.
# Initialization code that may require console input (password prompts, [y/n]
# confirmations, etc.) must go above this block; everything else may go below.
if [[ -r "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh" ]]; then
source "${XDG_CACHE_HOME:-$HOME/.cache}/p10k-instant-prompt-${(%):-%n}.zsh"
fi
# If you come from bash you might have to change your $PATH.
# export PATH=$HOME/bin:/usr/local/bin:$PATH
{
"Ansi 3 Color" : {
"Green Component" : 0.71372549019607845,
"Blue Component" : 0.48627450980392156,
"Red Component" : 0.82352941176470584
},
"Tags" : [
],
"Ansi 12 Color" : {
@pertrai1
pertrai1 / coc.json
Last active April 14, 2022 20:43
Coc Configuration
// coc-tsserver
// coc-eslint
// coc-prettier
// coc-angular
// coc-json
// coc-explorer
{
"explorer.width": 80,
"explorer.icon.enableNerdfont": true,
"explorer.previewAction.onHover": false,
@pertrai1
pertrai1 / init.vim
Last active April 21, 2022 18:15
NVim Config
" https://github.com/ThePrimeagen/.dotfiles/blob/master/nvim/.config/nvim/init.vim
" https://github.com/garybernhardt/dotfiles/blob/main/.vimrc
" https://gist.github.com/benawad/b768f5a5bbd92c8baabd363b7e79786f
" https://github.com/moraisaugusto/another-dotfiles
" https://github.com/rafi/vim-config
" ctrl-0 = alt-back
" ctrl-i = alt-forward
"
call plug#begin()