Skip to content

Instantly share code, notes, and snippets.

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

Rob Simpson pertrai1

🏠
Working from home
  • Waynesville, NC
View GitHub Profile
@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()
bind '"\e[A": history-search-backward'
bind '"\e[B": history-search-forward'
{
"$help": "https://aka.ms/terminal-documentation",
"$schema": "https://aka.ms/terminal-profiles-schema",
"actions": [
{
"command": {
"action": "copy",
"singleLine": false
},
"keys": "ctrl+c"
@pertrai1
pertrai1 / ohmyposhv3-v2.json
Last active October 24, 2021 02:15 — forked from shanselman/ohmyposhv3-v2.json
ohmyposhv3-v2
{
"final_space": true,
"console_title": true,
"console_title_style": "folder",
"blocks": [
{
"type": "prompt",
"alignment": "left",
"horizontal_offset": 0,
"vertical_offset": 0,
@pertrai1
pertrai1 / wallaby.js
Created December 14, 2020 14:40
Wallaby
// before starting: npm i -D ngx-wallaby-jest
const ngxWallabyJest = require('ngx-wallaby-jest');
module.exports = function(wallaby) {
return {
files: [
'src/**/*.+(ts|html|json|snap|css|less|sass|scss|jpg|jpeg|gif|png|svg)',
'tsconfig.json',
'jest.config.js',
'tsconfig.spec.json',
@pertrai1
pertrai1 / collectionSum.js
Last active December 8, 2020 10:00
collectionSum
const collectionSum = (collection) => {
const iterator = collection.iterator();
let eachIteration;
let sum = 0;
while ((eachIteration = iterator(), !eachIteration.done)) {
sum += eachIteration.value;
}
@pertrai1
pertrai1 / component.html
Last active May 9, 2020 17:59
RxJS Data Composition
<div *ngIf="product$ | async as products">
<ul>
<li *ngFor="let product of products">
{{ product.name }}
</li>
</ul>
</div>
@pertrai1
pertrai1 / deep-freeze.ts
Created January 2, 2020 21:03
Deep Freeze
function deepFreeze(value) {
if (Array.isArray(value)) {
for (const element of value) {
deepFreeze(element);
}
Object.freeze(value);
} else if (typeof value === 'object' && value !== null) {
for (const v of Object.values(value)) {
deepFreeze(v);
}
@pertrai1
pertrai1 / pipe.ts
Created October 23, 2019 02:04
Angular HTML Pipe
import { Pipe, PipeTransform } from '@angular/core';
/*
* Strips HTML
* Takes an input parameter HTML.
* Usage:
* content | striphtml
* Example:
* <p [innerHTML]="content | striphtml"></p>
*/
@Pipe({