Skip to content

Instantly share code, notes, and snippets.

View malachaifrazier's full-sized avatar
🏠
Working from home

Malachai malachaifrazier

🏠
Working from home
View GitHub Profile
@malachaifrazier
malachaifrazier / uscities.csv
Created January 20, 2020 23:15 — forked from kcsluis/uscities.csv
US Cities
We can't make this file beautiful and searchable because it's too large.
"city","city_ascii","state_id","state_name","county_fips","county_name","lat","lng","population","population_proper","density","source","incorporated","timezone","zips","id"
"Prairie Ridge","Prairie Ridge","WA","Washington","53053","Pierce","47.1443","-122.1408","","","1349.8","polygon","False","America/Los_Angeles","98360 98391","1840037882"
"Edison","Edison","WA","Washington","53057","Skagit","48.5602","-122.4311","","","127.4","polygon","False","America/Los_Angeles","98232","1840017314"
"Packwood","Packwood","WA","Washington","53041","Lewis","46.6085","-121.6702","","","213.9","polygon","False","America/Los_Angeles","98361","1840025265"
"Wautauga Beach","Wautauga Beach","WA","Washington","53035","Kitsap","47.5862","-122.5482","","","261.7","point","False","America/Los_Angeles","98366","1840037725"
"Harper","Harper","WA","Washington","53035","Kitsap","47.5207","-122.5196","","","342.1","point","False","America/Los_Angeles","98366","1840037659"
"Telma","Telma","WA","Washington","53007","Chelan","47.8432","-1
require 'nokogiri'
require 'zlib'
require 'open-uri'
require 'net/http'
require 'net/https'
=begin
To get up and running on local:
git clone git@bitbucket.org:mphteam/list-hub.git
change directories to list-hub (cd list-hub)
@malachaifrazier
malachaifrazier / README.md
Created November 7, 2019 22:48 — forked from bazzel/README.md
Rails 6 and Bootstrap 4

This blogpost shows how to setup Rails 6 with Bootstrap 4.

This snippet shows a somehow different and less customized approach.

$ rails new rails6-bootstrap4
$ bundle --binstubs
$ yarn add bootstrap jquery popper.js
@malachaifrazier
malachaifrazier / rails_new.md
Created November 7, 2019 19:17 — forked from patwey/rails_new.md
Steps for creating a new rails app with a Postgres database, Haml, RSpec and FactoryGirl

Steps

  1. Create app, skipping TestUnit and specifying a Postgres db: $ rails new app_name -T --database=postgresql

  2. Update the Gemfile: Gemfile:

    gem 'haml'
    gem 'haml-rails'

Setup Work

  • Make a list of competitive/alternative services: See competitors.md file
  • Set up Google News alerts for "side project marketing" and "startup marketing".
  • Make list of blogs, subscribe to RSS feeds in Feedbin:
    • Startup marketing blogs
    • Side project blogs
    • Small business marketing blogs
    • Chicago small business/startup bloggers
  • Come up with a name and domain name
@malachaifrazier
malachaifrazier / docker-destroy-all.sh
Created May 23, 2019 21:08 — forked from JeffBelback/docker-destroy-all.sh
Destroy all Docker Containers and Images
#!/bin/bash
# Stop all containers
docker stop $(docker ps -a -q)
# Delete all containers
docker rm $(docker ps -a -q)
# Delete all images
docker rmi $(docker images -q)
@malachaifrazier
malachaifrazier / log
Created May 21, 2019 08:35
Failed docker-up
➜ dev-setup git:(first-setup) ✗ docker-compose up
Recreating dev-setup_db_1 ... done
Recreating dev-setup_api_1 ... done
Recreating dev-setup_rails_1 ... done
Attaching to dev-setup_db_1, dev-setup_api_1, dev-setup_rails_1
db_1 | LOG: skipping missing configuration file "/pgdata/data/postgresql.auto.conf"
api_1 | [gin] Listening on port 3030
db_1 | postgres: could not find the database system
db_1 | Expected to find it in the directory "/pgdata/data",
db_1 | but could not open file "/pgdata/data/global/pg_control": No such file or directory
@malachaifrazier
malachaifrazier / elasticsearch17.rb
Created May 1, 2019 04:59 — forked from rohitjangid/elasticsearch17.rb
Installing Elastic Search 1.7 via homebrew
# in the terminal run brew install elasticsearch1.7.rb
class Elasticsearch17 < Formula
desc "Distributed search & analytics engine"
homepage "https://www.elastic.co/products/elasticsearch"
url "https://download.elastic.co/elasticsearch/elasticsearch/elasticsearch-1.7.6.tar.gz"
sha256 "78affc30353730ec245dad1f17de242a4ad12cf808eaa87dd878e1ca10ed77df"
revision 1
bottle :unneeded
@malachaifrazier
malachaifrazier / install_elasticsearch_osx.md
Created April 10, 2019 02:38 — forked from djonsson/install_elasticsearch_osx.md
OS X installation instructions for Elasticsearch + Kibana + Marvel

What is this?

Following this guide will set up a local Elasticsearch with Kibana and Marvel using Homebrew and Homebrew Cask

Prerequisites

If you already have Java installed on your system, skip steps Install Cask and Install Java

If you already have Java and Homebrew installed on your system, skip steps Prerequisites, start at Install Elasticsearch and Kibana after running $ brew update

Install Homebrew

  • $ ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
# This file was generated by the `rails generate rspec:install` command.
# Conventionally, all specs live under a `spec` directory, which RSpec adds to
# the `$LOAD_PATH`. The generated `.rspec` file contains `--require spec_helper`
# which will cause this file to always be loaded, without a need to explicitly
# require it in any files.
#
# Given that it is always loaded, you are encouraged to keep this file as
# light-weight as possible. Requiring heavyweight dependencies from this file
# will add to the boot time of your test suite on EVERY test run, even for an
# individual file that may not need all of that loaded. Instead, consider making