Skip to content

Instantly share code, notes, and snippets.

@sgraham785
sgraham785 / 0_reuse_code.js
Created October 5, 2013 09:27
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@sgraham785
sgraham785 / README.md
Created March 2, 2014 08:26 — forked from agnoster/README.md
Agnoster ZSH Theme

agnoster.zsh-theme

A ZSH theme optimized for people who use:

  • Solarized
  • Git
  • Unicode-compatible fonts and terminals (I use iTerm2 + Menlo)

For Mac users, I highly recommend iTerm 2 + Solarized Dark

#!/bin/sh
#
# a simple way to parse shell script arguments
#
# please edit and use to your hearts content
#
ENVIRONMENT="dev"
#!/bin/sh
rpm -Uih https://dl.fedoraproject.org/pub/epel/6/i386/epel-release-6-8.noarch.rpm
curl -L https://get.rvm.io | bash -s stable
source /etc/profile.d/rvm.sh
rvm install 2.0.0
rvm use 2.0.0@global --default
### install bundler and rails
gem install bundler --no-ri --no-rdoc
@sgraham785
sgraham785 / rm-rf_svn
Created January 21, 2015 20:02
Recursively rm .svn
find . -type d -name .svn -exec rm -rf {} \;
@sgraham785
sgraham785 / dig_domains.sh
Created January 21, 2015 20:12
Dig domains from txt file
#!/bin/bash
## HOW TO USE
# sh dig_domains.sh A "8.8.8.8" (this returns the A records)
# domain.com 1224 IN A 127.0.0.1
# sh dig_domains.sh A "8.8.8.8" "mail." (returns the mail. subdomain A records)
# mail.domain1.com. 14399 IN CNAME domain1.com.
# mail.domain2.com. 3599 IN A 127.0.0.1

change to postgres user and open psql prompt

sudo -u postgres psql postgres`

list databases

postgres=# \l
@sgraham785
sgraham785 / README.md
Last active January 10, 2017 21:35
Project README.md Starter Template

Project Title

TODO: Write a project description

Prerequisites

TODO: Add requirements and dependencies

Installation

message ObjectId {
// Unordered map of dynamically typed values.
map<string, Value> id = 1;
string _bsontype = 2; // should return "ObjectId"
}
// The JSON representation for `Value` is JSON value.
enum Value {
VALUE = 1;
}
@sgraham785
sgraham785 / pg_premissions.sql
Created February 22, 2018 06:15
Postgres DB Permissions example
--ACCESS DB
REVOKE CONNECT ON DATABASE nova FROM PUBLIC;
GRANT CONNECT ON DATABASE nova TO user;
--ACCESS SCHEMA
REVOKE ALL ON SCHEMA public FROM PUBLIC;
GRANT USAGE ON SCHEMA public TO user;
--ACCESS TABLES
REVOKE ALL ON ALL TABLES IN SCHEMA public FROM PUBLIC ;