Skip to content

Instantly share code, notes, and snippets.

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

Jaymie Jones jaymiejones86

🏠
Working from home
View GitHub Profile
@jaymiejones86
jaymiejones86 / jquery_pdf_new_window.js
Created May 28, 2012 22:08
Open any anchor which has a file extension of PDF in a new window with jQuery.
$('a[href$=".pdf"]').click(function(e) {
e.preventDefault();
window.open(this.href);
});
@jaymiejones86
jaymiejones86 / osx_lion_rail_setup.md
Created July 1, 2012 23:18 — forked from jpantuso/osx_lion_rail_setup.md
Setup OS X 10.7 w/ homebrew, oh-my-zsh, rvm, rails, and MySQL
@jaymiejones86
jaymiejones86 / gist:3868169
Created October 10, 2012 20:21
Fix Drush PDO issue on Mac OSX
sudo mkdir /var/mysql
sudo ln -s /Applications/MAMP/tmp/mysql/mysql.sock /var/mysql/mysql.sock
@jaymiejones86
jaymiejones86 / gist:3956180
Created October 25, 2012 23:42
Postgres Dump and Export
# Dump
pg_dump -U username -W -h localhost dbname -f dump.sql
# Import
psql -U username -h localhost dbname -f /home/username/dump.sql
@jaymiejones86
jaymiejones86 / App Second Request 200 - OK
Created December 11, 2012 09:32
App First Request 401 Unauthorised
GET http://subdomain.exampleapp.dev/api/deals/7589
Header Authorization token xyz123
Headers
Cache-Control: max-age=0, private, must-revalidate
Connection: Keep-Alive
Content-Type: application/json; charset=utf-8
Date: Tue, 11 Dec 2012 09:28:01 GMT
Etag: "b6b44c59b785dcbc6349fe31129f00b0"
@jaymiejones86
jaymiejones86 / gist:4257325
Created December 11, 2012 09:35
Processed Response, 200, 401, 200, 401
Started GET "/api/deals/7589" for 127.0.0.1 at 2012-12-11 20:33:13 +1100
Processing by Api::V1::DealsController#show as JSON
Parameters: {"id"=>"7589"}
User Load (0.5ms) SELECT "users".* FROM "users" WHERE "users"."account_id" = 6 AND "users"."id" = 8 LIMIT 1
Opro::Oauth::AuthGrant Load (0.3ms) SELECT "opro_auth_grants".* FROM "opro_auth_grants" WHERE "opro_auth_grants"."access_token" = '25ab40012c839451914aa69eef3c077a' LIMIT 1
User Load (0.4ms) SELECT "users".* FROM "users" WHERE "users"."account_id" = 6 AND "users"."id" IN (8)
Opro::Oauth::ClientApp Load (0.2ms) SELECT "opro_client_apps".* FROM "opro_client_apps" WHERE "opro_client_apps"."id" IN (1)
Account Load (0.2ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 6]]
CACHE (0.0ms) SELECT "accounts".* FROM "accounts" WHERE "accounts"."id" = $1 LIMIT 1 [["id", 6]]
AppNotice Load (0.2ms) SELECT "app_notices".* FROM "app_notices"
module Api
module V1
class DealsController < ApplicationController
respond_to :json
allow_oauth!
before_filter :authenticate_user!
load_and_authorize_resource
def index
respond_with Deal.all
@jaymiejones86
jaymiejones86 / site_check
Created November 2, 2015 21:53
Site Check
bundle exec brakeman -o security.html
bundle exec rails_best_practices --output-file best_practices.html -f html .
open security.html
open best_practices.html
bundle-audit
@jaymiejones86
jaymiejones86 / ftpquoatcheck.sh
Created May 6, 2013 22:55
Force Update of FTP Quotes in cPanel
/scripts/ftpquotacheck --force

https://github.com/thoughtbot/laptop | thoughtbot/laptop https://github.com/thoughtbot/dotfiles | thoughtbot/dotfiles https://github.com/jetrockets/attrio | jetrockets/attrio https://www.solanolabs.com/product | Solano Labs | Product http://robots.thoughtbot.com/post/56828751507/how-to-create-postgres-indexes-concurrently-in | How to Create Postgres Indexes Concurrently in ActiveRecord Migrations http://robots.thoughtbot.com/post/55689359336/the-perils-of-uniqueness-validations | The Perils of Uniqueness Validations https://github.com/trptcolin/consistency_fail | trptcolin/consistency_fail http://dansowter.com/mailman-guide/ | dansowter.com | Mailman Guide https://discussions.apple.com/thread/4932384?start=0&tstart=0 | Quicktime Screen Recording Makes Green...: Apple Support Communities http://www.timseverien.nl/promin/ | Promin - sexy forms