Skip to content

Instantly share code, notes, and snippets.

View BrianSigafoos's full-sized avatar

Brian Sigafoos BrianSigafoos

View GitHub Profile
#chat-box.ubuntu.hidden-xs
.closed
.pull-right
= link_to_function content_tag(:i, nil, class: 'glyphicon glyphicon-chevron-up').html_safe, 'chat.show()'
.m-l-small
= link_to_function 'Chat with us', 'chat.show()'
.opened{style: 'display: none'}
.header
.pull-right
= link_to_function content_tag(:i, nil, class: 'glyphicon glyphicon-plus-sign').html_safe, 'chat.maximize()', class: 'maximize', style: 'display: none'
@BrianSigafoos
BrianSigafoos / sf-coworking
Last active August 29, 2015 14:02 — forked from gabriel/gist:6998753
SF Co-working spaces & prices
Parisoma @ 11th & Howard
http://www.parisoma.com/startups/#dedicated
$595
Sandbox Suites @ 10th & Mission
http://www.sandboxsuites.com/coworking/
$495, $595 (skybox)
Hub @ 5th & Mission
https://bayarea.impacthub.net/join-us/
# Word and Character Count service for Mac OS X
# Adds a Word and Character Count option to the text selection context menu
# Use Automator.app to create a new service, and then select the Run AppleScript
# action. Paste in this code and save as Word and Character Count. Now switch to
# a new app, select some text, and open the context menu to find the new option.
# Copyright 2012, Noah Slater <nslater@apache.org>
@BrianSigafoos
BrianSigafoos / aws_s3_set_cache_control_max-age.rb
Last active August 29, 2015 14:24 — forked from rahul100885/s3_header.rb
AWS S3 Cache Control Max-Age
#!/usr/bin/env ruby
require 'rubygems'
require 'aws-sdk'
s3 = AWS::S3.new(
:access_key_id => 'PASTE_HERE',
#### SECRET KEY #####
:secret_access_key => 'PASTE_SECRET_KEY_HERE')
#### DO NOT COMMIT ####
@BrianSigafoos
BrianSigafoos / ssl_puma.sh
Created January 13, 2017 17:35 — forked from tadast/ssl_puma.sh
localhost SSL with puma
# 1) Create your private key (any password will do, we remove it below)
$ cd ~/.ssh
$ openssl genrsa -des3 -out server.orig.key 2048
# 2) Remove the password
$ openssl rsa -in server.orig.key -out server.key
@BrianSigafoos
BrianSigafoos / postgres-cheatsheet.md
Created January 25, 2017 17:38 — forked from Kartones/postgres-cheatsheet.md
PostgreSQL command line cheatsheet

PSQL

Magic words:

psql -U postgres

If run with -E flag, it will describe the underlaying queries of the \ commands (cool for learning!).

Most \d commands support additional param of __schema__.name__ and accept wildcards like *.*

@BrianSigafoos
BrianSigafoos / README.md
Created August 24, 2017 18:54 — forked from joyrexus/README.md
curl tutorial

An introduction to curl using GitHub's API.

Basics

Makes a basic GET request to the specifed URI

curl https://api.github.com/users/caspyin

Includes HTTP-Header information in the output

@BrianSigafoos
BrianSigafoos / capybara.md
Created August 31, 2017 20:55 — forked from remi/capybara.md
RSpec Matchers

Capybara

save_and_open_page

Matchers

have_button(locator)
@BrianSigafoos
BrianSigafoos / aws_create_users_ubuntu.sh
Created February 4, 2019 15:43 — forked from vasansr/aws_create_users_ubuntu.sh
AWS User Data Script to create users when launching an Ubuntu server EC2 instance
#!/bin/bash
#
# Initial script to create users when launching an Ubuntu server EC2 instance
#
declare -A USERKEY
#
# Create one entry for every user who needs access. Be sure to change the key to their
@BrianSigafoos
BrianSigafoos / db.rake
Created May 9, 2019 13:32 — forked from khalilgharbaoui/db.rake
Rails rake tasks for dump & restore of PostgreSQL databases
# Original source: https://gist.github.com/hopsoft/56ba6f55fe48ad7f8b90
# Merged with: https://gist.github.com/kofronpi/37130f5ed670465b1fe2d170f754f8c6
# Benefits of: https://gist.github.com/e12e/e0c7d2cc1d30d18c8050b309a43450ac
# And fixes of: https://gist.github.com/joelvh/f50b8462611573cf9015e17d491a8a92
namespace :db do
desc 'Dumps the database to backups'
task dump: :environment do
dump_fmt = ensure_format(ENV['format'])
dump_sfx = suffix_for_format(dump_fmt)
backup_dir = backup_directory(Rails.env, create: true)