Skip to content

Instantly share code, notes, and snippets.

View barryblando's full-sized avatar
🗃️

Retr0_0x315 barryblando

🗃️
View GitHub Profile
@barryblando
barryblando / AvoidMergeConflicts.md
Last active December 26, 2017 01:33
How to Avoid Merge Conflicts

Tip #1 Run the "git pull" command as often as possible

If you're working with a team of other developers you want to constantly be pulling in their commits from the server so that you're working with the latest code you want to make this part of your routine, so running "git pull" just becomes a habit. Any time you sit down to work on your project before you actually edit any files, run a "git pull".

Tip #2 Communicate with your team

Simply communicating with your team can go a long way. Talk with each other about who is responsible for which changes and which parts of the project. Be aware of what each team member is working on for that day or week and you don't need to go overboard and waste a ton of time chatting about what you're working on. But you'd be surprised. Even just having a general idea of what each person is working on will put you in a position where you are far less likely to edit the same lines of code within the same file at the same time and that means less conflicts.

Ti

@barryblando
barryblando / .eslintrc
Last active September 26, 2020 13:35
VSCode Setup Prettier + ESLint + StyleLint for React
{
"extends": [
"airbnb",
"prettier",
"prettier/react"
],
"parser": "babel-eslint",
"parserOptions": {
"ecmaVersion": 8,
"ecmaFeatures": {
@barryblando
barryblando / css-media-query.md
Last active January 3, 2019 03:15
CSS media query rules - Easy to understand

CSS Media Queries: Best Practices

@barryblando
barryblando / scss.md
Created January 3, 2019 03:17
Advanced SCSS

Advanced SCSS

Or, 16 cool things you may not have known your stylesheets could do. I'd rather have kept it to a nice round number like 10, but they just kept coming. Sorry.

I've been using SCSS/SASS for most of my styling work since 2009, and I'm a huge fan of Compass (by the great @chriseppstein). It really helped many of us through the darkest cross-browser crap. Even though browsers are increasingly playing nice with CSS, another problem has become very topical: managing the complexity in stylesheets as our in-browser apps get larger and larger. SCSS is an indispensable tool for dealing with this.

This isn't an introduction to the language by a long shot; many things probably won't make sense unless you have some SCSS under your belt already. That said, if you're not yet comfy with the basics, check out the awesome CSS extensions you've always wished you had:

  • [
@barryblando
barryblando / workspacesetting.md
Last active January 4, 2019 01:59
VSCODE Workspace

VSCODE WORKSPACE SETTING FOR REACT w/ ESLINT + PRETTIER

ESLINT

{
  "extends": [
    "airbnb",
    "prettier",
    "prettier/react"
// PS. This is cool for play, but always remember that code is for human consumption.
// Especially the use of lambdas in the second example gets confusing fast.
// Remove any duplicates from an array of primitives.
const unique = [...new Set(arr)]
// Sleep in async functions lambdas. Use: await sleep(2000).
const sleep = (ms) => (new Promise(resolve => setTimeout(resolve, ms)));
// Type this in your code to break chrome debugger in that line.
@barryblando
barryblando / autocomplete.jsx
Created April 2, 2019 09:15
Rxjs + Downshift Autocomplete
import React from 'react';
import Downshift from 'downshift';
import Rx from 'rxjs';
import { ajax } from 'rxjs/observable/dom/ajax';
const makeUrl = search =>
`https://en.wikipedia.org/w/api.php?action=query&format=json&list=search&utf8=1&srsearch=${encodeURIComponent(str)}`;
const input$ = new Rx.Subject();

MySQL Cheat Sheet

Help with SQL commands to interact with a MySQL database

MySQL Locations

  • Mac /usr/local/mysql/bin
  • Windows /Program Files/MySQL/MySQL version/bin
  • Xampp /xampp/mysql/bin

Add mysql to your PATH

@barryblando
barryblando / postgre-cheatsheet.md
Last active May 13, 2020 01:52
PostgreSQL CheatSheet

PSQL

Magic words:

psql -U postgres

Some interesting flags (to see all, use -h or --help depending on your psql version):

  • -E: will describe the underlaying queries of the \ commands (cool for learning!)
  • -l: psql will list all databases and then exit (useful if the user you connect with doesn't has a default database, like at AWS RDS)
@barryblando
barryblando / 📊 Weekly development breakdown
Last active March 24, 2023 01:24
📊 Weekly development breakdown
Go 17 hrs 24 mins ███████████████████▌░ 93.2%
Lua 1 hr 8 mins █▎░░░░░░░░░░░░░░░░░░░ 6.1%
TypeScript 2 mins ░░░░░░░░░░░░░░░░░░░░░ 0.2%
Markdown 1 min ░░░░░░░░░░░░░░░░░░░░░ 0.2%
Other 1 min ░░░░░░░░░░░░░░░░░░░░░ 0.1%