Skip to content

Instantly share code, notes, and snippets.

View brockthebear's full-sized avatar
💭
Ship Ship Ship

Brock Boren brockthebear

💭
Ship Ship Ship
View GitHub Profile
@brockthebear
brockthebear / osx-setup.sh
Last active May 11, 2021 20:40 — forked from somebox/osx-setup.sh
Set up an OSX machine from zero to awesome. Uses Homebrew (and cask, fonts, etc). Focused on Ruby/Rails development, includes rvm, xquartz, editor fonts, sublime text, and many tools.
#!/bin/bash
# A script to set up a new mac. Uses bash, homebrew, etc.
# Focused for ruby/rails development. Includes many utilities and apps:
# - homebrew, rvm, node
# - quicklook plugins, terminal fonts
# - browsers: chrome, firefox
# - dev: iterm2, sublime text, postgres, chrome devtools, etc.
# - team: slack, dropbox, google drive, skype, etc
<div class='grid__item one-third small--one-whole'>
<img class='logo_footer' width='100px' height='auto' src='your-url-here' />
</div>
@brockthebear
brockthebear / .hyper.js
Last active April 20, 2021 23:44
Hyper Settings
// Future versions of Hyper may add additional config options,
// which will not automatically be merged into this file.
// See https://hyper.is#cfg for all currently supported options.
/* cSpell:disable */
module.exports = {
config: {
// Choose either "stable" for receiving highly polished,
// or "canary" for less polished but more frequent updates
@brockthebear
brockthebear / web-dev-resources.md
Created July 29, 2019 16:50
Resources for anybody wanting to learn how to code (with an emphasis on front-end tech).

Web Dev Resources

⭐ = favorite


Required Reading

Paul Ford: What Is Code? - It’s long but nothing ever got me so excited about learning to code as much as this.

Tutorials

  • Free (mostly)
@brockthebear
brockthebear / fabfile.py
Last active June 7, 2019 17:14
Example deployment of a Node app using Fabric
#!/usr/local/bin/python3
# List tasks with fab2 -l
import os
import os.path as path
from fabric2 import Config, Connection, task
import patchwork.transfers as transfer
# Define values in .env file.
@brockthebear
brockthebear / mongo-export-csv.js
Last active May 16, 2019 17:36
Export a MongoDB collection and write to a CSV. Uses json2csv, async/await, and dotenv.
require('dotenv').config();
const { AsyncParser } = require('json2csv');
const fs = require('fs');
const MongoClient = require('mongodb').MongoClient;
const url = `mongodb://localhost:27017`;
const HEADERS = ['first_name', 'last_name', 'middle_name', 'id'];
const FIELDS = ['name.first_name', 'name.last_name', 'name.middle_name', 'id'];
@brockthebear
brockthebear / convert.sh
Last active February 17, 2024 18:17
Recursively find and convert files in place using ImageMagick and Mogrify
# This command would be run from the parent folder that:
# 1. contains the file(s) to be converted
# 2. has subdirectories that contain files to be converted
# 3. both of the above.
# This example finds all .tif files and converts them to .pdf,
# but any conversion supported by ImageMagick could be used here.
# If you don't have ImageMagick installed, you can do so here (https://imagemagick.org/script/download.php)
# for linux
using System;
public static class Leap
{
public static bool IsLeapYear(int year)
{
bool multipleOf4 = YearIsDivisibleByFactor(year, 4);
bool multipleOf100 = YearIsDivisibleByFactor(year, 100);
bool multipleOf400 = YearIsDivisibleByFactor(year, 400);
#!/usr/bin/env bash
set -o errexit
set -o nounset
main() {
echo "Hello, World!"
}
main