Skip to content

Instantly share code, notes, and snippets.

View briangonzalez's full-sized avatar
🏠
🚚

Brian Gonzalez briangonzalez

🏠
🚚
View GitHub Profile
@briangonzalez
briangonzalez / index.js
Last active December 14, 2017 19:26
Custom Casing ESlint Rules
const checkAndReport (token, correct, context) {
if (token.toLowerCase().includes(correct.toLowerCase()) && !token.includes(correct))) {
context.report(node, `The standard variable casing is "${correct}", not ${node.id.name}`);
}
}
module.exports.rules = {
"paypal-casing": context => ({
VariableDeclarator: (node) => {
checkAndReport(node.id.name, 'Paypal', context)
activate application "Reminders"
tell application "Finder"
set _b to bounds of window of desktop
set _width to item 3 of _b
set _height to item 4 of _b
end tell
tell application "System Events"
@briangonzalez
briangonzalez / typescript-vs-flow.md
Last active November 3, 2017 17:11
Typescript vs. Flow

Flow vs. Typescript

Flow

Built by Facebook

Stats for past month: 0 merged PRs, 30 Proposed PRs, 50 closed issues, 135 new issues, SO Questions ~0.9k

  • 👍 Built by Facebook, just like React – in practice, this doesn’t seem to provide a marked advantage for flow
@briangonzalez
briangonzalez / using-bluebird.js
Created August 4, 2017 05:22
Parellelizing multiple API requests.
const Promise = require('bluebird');
const getResponses = async (urls) => {
const requests = urls.map(u => fetch /* fetch is a newish builtin API */)
const responses = await Promise.all(requests)
return responses
}
const urls = [
'https://foo.com/bar.json',
@briangonzalez
briangonzalez / fix-conflicts.sh
Created June 25, 2017 13:48
Fixing conflicts caused by merging in master with eslint changes
git checkout master
git pull
git checkout my-branch
git rebase master
# Get conflicts, flip a table.
# (╯°□°)╯︵
git checkout . --theirs # we don't care about what's in master, we just want our files and we'll fix eslint errors ourselves
./node_modules/.bin/eslint . --fix
//
// A user has purchased products from Dollar Shave Club,
// noted below in the `purchased` array. When these products
// came out of our database, they were unsorted.
//
// Write the method below, `sortProducts`, to obtain a sorted
// array of the items purchased.
//
const sortedReference = [
@briangonzalez
briangonzalez / _briangonzalez.org
Last active January 7, 2020 15:51
briangonzalez.org
# This file is blank, but here in order to have more clear view of the gist from within github.
@briangonzalez
briangonzalez / about.page.md
Last active March 11, 2017 02:10
eggplanet.io

eggplanet is an LA-based development shop started by two of the early engineers of Dollar Shave Club. We have experience building and optimizing apps as well helping teams grow and become more efficient.

import Ember from 'ember';
export default Ember.Component.extend({
classNameBindings: [ 'loaded:no-blur:blur' ],
loaded: false,
src: Ember.computed(function () {
return `${this.get('rawSrc')}?w=10`;
@briangonzalez
briangonzalez / circle.yml
Created August 8, 2016 14:28
Chrome + Circle
---
machine:
node:
version: 5.11.1
checkout:
post:
- git fetch origin
- git branch --force lint-ci-release origin/release