Skip to content

Instantly share code, notes, and snippets.

@user512
user512 / delete-postmaster.pid.md
Created October 12, 2021 03:23 — forked from zulhfreelancer/delete-postmaster.pid.md
Postgres.app: How to delete postmaster.pid file?
$ cd ~/Library/Application\ Support/Postgres/var-10
$ \rm -f postmaster.pid

OR

$ \rm -f ~/Library/Application\ Support/Postgres/var-10/postmaster.pid
@user512
user512 / subdomain-localhost-rails-5.md
Created April 26, 2020 20:23 — forked from indiesquidge/subdomain-localhost-rails-5.md
how to access subdomains locally with Rails 5

Subdomaining Localhost with Rails 5

I've been following this blog post on how to set up an api-only Rails 5 application. One of the sections talks about creating a subdomain for your api

Rails.application.routes.draw do
  constraints subdomain: "api" do
    scope module: "api" do
@user512
user512 / webpack_wevote.md
Last active May 31, 2019 03:51
Draft Webpack build pull request on WeVote

What github.com/wevote/WebApp/issues does this fix?

wevote/WebApp#757

Changes included this pull request?

Purpose

The purpose of this pull request is to refactor the build process for WebApp. WebApp currently uses gulp + browserify to build the source files. The primary product of this build process is the single bundle.js file which contains the app’s main javascript logic. The problem is that it can take over 2 minutes to generate this file. Even a small change to one file means that we must wait 2 minutes for the entire bundle.js to rebuild. With webpack, we have reduced the build time down to less than 70 seconds (initial build) & 3 seconds (hot reload) (using weback’s hot-rebuilding capabilities).

Introduced webpack with docs

@user512
user512 / setup.md
Created April 15, 2019 01:46
Setup React and Node development environment on Windows
@user512
user512 / clone_dbc_repo.rb
Last active December 28, 2017 20:50
clone dbc repo
require 'json'
def clone_repo
page_num = 1
loop do
# replace sf-grasshoppers-2015 with your cohort name
json = %x[curl 'https://api.github.com/orgs/sf-grasshoppers-2015/repos?per_page=100&page=#{page_num}' -u <username>:<personal_access_token>]
json = JSON.parse(json)
break if json.empty?
json.each { |repo| %x[git clone #{repo["ssh_url"]} ] }
page_num += 1
@user512
user512 / vpn_psk_bingo.md
Created November 17, 2017 16:10 — forked from kennwhite/vpn_psk_bingo.md
Most VPN Services are Terrible

Most VPN Services are Terrible

Short version: I strongly do not recommend using any of these providers. You are, of course, free to use whatever you like. My TL;DR advice: Roll your own and use Algo or Streisand. For messaging & voice, use Signal. For increased anonymity, use Tor for desktop (though recognize that doing so may actually put you at greater risk), and Onion Browser for mobile.

This mini-rant came on the heels of an interesting twitter discussion: https://twitter.com/kennwhite/status/591074055018582016

@user512
user512 / README.md
Created June 23, 2017 18:30 — forked from jondkinney/README.md
jondkinney's console vim setup

Console VIM and Tmux setup compatible with Mac OS X and Linux.

Installation

Because this script prompts for user input, you have to execute it in a bit of an odd way. From a new command prompt simply copy and paste the following command and press return:

exec 3<&1;bash <&3 <(curl https://gist.githubusercontent.com/jondkinney/2040114/raw/vim.sh 2> /dev/null)
@user512
user512 / rvm2rbenv.txt
Created August 1, 2016 20:03 — forked from shrwnsan/rvm2rbenv.txt
Migration from RVM to RBENV
## Prepare ###################################################################
# Remove RVM
rvm implode
sudo rm -rf ~/.rvm
sudo rm -rf ~/.rvmrc
sudo rm -rf /etc/rvmrc
# Also, please check all .bashrc .bash_profile .profile and .zshrc for RVM source lines and delete or comment out if this was a Per-User installation.
@user512
user512 / opportunity-hack-2015.md
Last active October 3, 2015 17:37
Opportunity Hack 2015

Opportunity Hack 2015

Hillary Hartley

  • Set realisitc expectations
  • Attract talent to your team
  • Tools & framworks to get to work quickly
  • Gov web standard
  • Envision your perfect demo and work backwards
@user512
user512 / best.md
Created September 12, 2015 18:55
best question 7
require 'prime'

count = 1
number = 2

until count == 10001
  number += 1
  count += 1 if number.prime?
end