Skip to content

Instantly share code, notes, and snippets.

View briangonzalez's full-sized avatar
🏠
🚚

Brian Gonzalez briangonzalez

🏠
🚚
View GitHub Profile
@briangonzalez
briangonzalez / README.md
Created October 21, 2012 04:25
img2boxshadow - a ruby script to convert images to CSS [http://codepen.io/briangonzalez/details/AvrGI#pen-details-tab]

img2boxshadow.rb

a ruby script to convert images to CSS (box-shadows)

Installation

gem install rmagick    # you'll need ImageMagick & Ruby first
gem install colormath
gem install micro-optparse
@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 / howto.md
Last active January 5, 2020 18:59
Installing Dropbox on CentOS

Setup Dropbox for system startup

The following instructions will get you setup to run Dropbox at system start. Below, also find instructions on how to install the Dropbox CLI.

# Login as root and go into home dir.
sudo su && cd ~

# Download Dropbox depending on architecture (uname -a) and unpack.
# You will need to repeat this "download and unpack" step for all users
@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 / 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.