Skip to content

Instantly share code, notes, and snippets.

View ryanwjackson's full-sized avatar

Ryan ryanwjackson

  • Paid
  • San Francisco, CA
View GitHub Profile
@ryanwjackson
ryanwjackson / gist:6107335
Created July 29, 2013 20:09
HandsonTable Custom Render
$(document).ready(function() {
var container = $("#edit-metrics-handson-table")
var renderResponse = function (instance, td, row, col, prop, value, cellProperties) {
if (row == 0 || col == 0) {
cellProperties.readOnly = true;
}
@ryanwjackson
ryanwjackson / gist:6108488
Created July 29, 2013 22:30
Handsontable Implementation
$(document).ready(function() {
var handson_table_data = []
var container = $("#edit-metrics-handson-table")
var renderResponse = function (instance, td, row, col, prop, value, cellProperties) {
if (row == 0 || col == 0) {
cellProperties.readOnly = true;

Installing a Gem on Heroku from a Private GitHub Repo

Sometimes you want to use a gem on Heroku that is in a private repository on GitHub.

Using git over http you can authenticate to GitHub using basic authentication. However, we don't want to embed usernames and passwords in Gemfiles. Instead, we can use authentication tokens.

  1. Get an OAuth Token from GitHub

First you will need to get an OAuth Token from GitHub using your own username and "note"

def wrap_in_transaction
ActiveRecord::Base.transaction do
current_account.with_lock('FOR UPDATE') do
begin
yield
ensure
raise ActiveRecord::Rollback
end
end
end
#!/bin/sh
echo "What should the Application be called (no spaces allowed e.g. GCal)?"
read inputline
name="$inputline"
echo "What is the url (e.g. https://www.google.com/calendar/render)?"
read inputline
url="$inputline"

Keybase proof

I hereby claim:

  • I am ryanwjackson on github.
  • I am ryanwjackson (https://keybase.io/ryanwjackson) on keybase.
  • I have a public key whose fingerprint is 3CFD CD47 46A8 EB8C 9C75 C5E1 7F23 995D 67A9 B320

To claim this, I am signing this object:

@ryanwjackson
ryanwjackson / postgres_queries_and_commands.sql
Last active April 18, 2017 20:53 — forked from rgreenjr/postgres_queries_and_commands.sql
Useful PostgreSQL Queries and Commands
-- show running queries (pre 9.2)
SELECT procpid, age(query_start, clock_timestamp()), usename, current_query
FROM pg_stat_activity
WHERE current_query != '<IDLE>' AND current_query NOT ILIKE '%pg_stat_activity%'
ORDER BY query_start desc;
-- show running queries (9.2)
SELECT pid, age(query_start, clock_timestamp()), usename, query
FROM pg_stat_activity
WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%'
@ryanwjackson
ryanwjackson / test.rb
Last active August 31, 2017 20:20
Test
puts '1234'
class ImagemagickAT6 < Formula
desc "Tools and libraries to manipulate images in many formats"
homepage "https://www.imagemagick.org/"
# Please always keep the Homebrew mirror as the primary URL as the
# ImageMagick site removes tarballs regularly which means we get issues
# unnecessarily and older versions of the formula are broken.
url "https://dl.bintray.com/homebrew/mirror/imagemagick%406-6.9.8-10.tar.xz"
mirror "https://www.imagemagick.org/download/ImageMagick-6.9.8-10.tar.xz"
sha256 "8fc268f6e1bc514b41620e0f3f6c5dd33bfc5169db679e9a5c0455c6edd11810"