Skip to content

Instantly share code, notes, and snippets.

View beelarr's full-sized avatar
🍩

Bryon Larrance beelarr

🍩
  • Software Development Consultant (React, Typescript, GraphQL, Next.js, CMS integration, Segment - GTM, Leanplum, Pixel Integration, Design Systems)
  • Remote
  • LinkedIn in/beelarr
View GitHub Profile
git show some_commit_sha1 -- some_file | git apply -R
const input = ["[[)}", "{()}"]
const balanceBrackets = arr => {
const result = arr.map(string => {
const stack = [];
const map = {
'(': ')',
'[': ']',
'{': '}'
// Sort an Array of Objects by a different sorting Array
const sortedList = ['alice', 'clara', 'bob'];
const people = [{
name: 'alice',
age: 101
}, {
name: 'bob',
age: -10
}, {
docker images purge
docker system prune -a
@beelarr
beelarr / List_open_files
Last active December 31, 2017 18:19
Seeing what servers are running
lsof -wni tcp:3000
kill -9 <server #>
import React, { Component } from 'react';
import { observer, inject } from 'mobx-react';
import MapGL, { Marker, FlyToInterpolator } from 'react-map-gl';
import token from '../../../Creds/Creds';
import moment from 'moment'
if (!token) {
throw new Error('That token is bad');
}
for (let i = 0; i < 101; i++){
let output = '';
if (i % 3 === 0) output = "Fizz"
if (i % 5 === 0) output += "Buzz"
console.log(output || i)
};
for(i=0;i<100;)console.log((++i%3?'':'Fizz')+(i%5?'':'Buzz')||i)
SOLID
Single Responsibility Principle - class should have one job
Open Closed Principle - Objects should be OPEN for extension but closed for modification
Liskov Substitution Principle - can a subtype substitute for a base type
-- if S is a subtype of T, then objects of type T may be replaced with objects of type S
Interface Segregation Principle - “many client-specific interfaces are better than one general-purpose interface--no client should be forced to depend on methods it does not use
Dependency Inversion Principle - High-level modules should not depend on low-level modules. Both should depend on abstractions.
/////////////////////////////////////////////
// What is a class?
- They hold data
- They have methods that interact with that data
- They instantiate objects
// What is an object?
- An instance of a class
- Classes descend from the Object root class
// What is a module?
Make great software and the tooling and learning will come.
// Event Delegation
An event listener is fired on all child elements (event bubbling)
An event listener is fired on all parent elements (bubble up)
Target is what was actually clicked
Current Target is what the event listener is attached to
///////////////////////////////////////////////////////////