Skip to content

Instantly share code, notes, and snippets.

View jrgifford's full-sized avatar
:shipit:
This is like AIM all over again, isn't it?

James Gifford jrgifford

:shipit:
This is like AIM all over again, isn't it?
View GitHub Profile
@jrgifford
jrgifford / gist:6e3cfb2f3edb645fc804
Created December 28, 2015 18:47 — forked from tinogomes/gist:1182499
credit card validation on ruby
# References
# http://en.wikipedia.org/wiki/Bank_card_number
# http://en.wikipedia.org/wiki/Luhn_algorithm
def valid_credit_card?(number)
number = number.to_s.gsub(/\D/, "")
return false unless valid_association?(number)
number.reverse!
@jrgifford
jrgifford / pdfx.rb
Last active August 31, 2015 20:55 — forked from fidothe/pdfx.rb
Worked example for creating a PDF/X-1a:2003 document with Prawn
require 'prawn'
require 'prawn/measurements'
# I have a small collection of links to the resources I used to figure all
# this out: http://pinboard.in/u:fidothe/t:pdfx
module PDFX
class PageBox
include Prawn::Measurements
attr_reader :bleed_mm
@jrgifford
jrgifford / gist:224f26f2144a522fc947
Last active August 29, 2015 14:26 — forked from alexmcpherson/gist:e414f92976f90e6a46a9
Culture for Kapost Bonsai

Practical / Tactical

Be on time to meetings or alert an hour ahead of time if you'll be late

Meetings need a goal and a runner to get that goal accomplished

Defend your time from distractions and use it effectively on moving product forward

Prefer Slack over email over in person interruptions over a set block of time


# Product Name

1. bullet point
2. list
3. of
4. issues

Screenshots:

Keybase proof

I hereby claim:

  • I am jrgifford on github.
  • I am jrg (https://keybase.io/jrg) on keybase.
  • I have a public key whose fingerprint is 1DDA 6D37 9A3F 5643 CB19 43F9 1E3B 896E BFFF 50D3

To claim this, I am signing this object:

Keybase proof

I hereby claim:

  • I am jrgifford on github.
  • I am jrg (https://keybase.io/jrg) on keybase.
  • I have a public key whose fingerprint is C950 AEA2 3127 88D7 470B 67BC C2E0 71AA 27F2 240C

To claim this, I am signing this object:

if node[:scout][:plugin_gems]
gem_package node[:scout][:plugin_gems] do
if node[:scout][:rvm_wrapper]
gem_binary File.join(node[:scout][:rvm_wrapper],"gem")
end
action :upgrade
end
end
irb(main):001:0> [:thing1 => "thing1", :thing2 => "thing2"]
=> [{:thing1=>"thing1", :thing2=>"thing2"}]
irb(main):002:0> [thing1: "thing1", thing2: "thing2"]
=> [{:thing1=>"thing1", :thing2=>"thing2"}]
irb(main):003:0> [:thing1 => "thing1", thing2: "thing2"]
=> [{:thing1=>"thing1", :thing2=>"thing2"}]
irb(main):004:0>
sudo apt-get install phablet-tools
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following extra packages will be installed:
apparmor-easyprof apparmor-easyprof-ubuntu aptitude aptitude-common at bzr bzr-builddeb click click-apparmor dctrl-tools debian-archive-keyring debian-keyring debootstrap
devscripts distro-info distro-info-data dput gir1.2-click-0.4 gir1.2-gee-0.8 gir1.2-json-1.0 libalgorithm-diff-perl libalgorithm-diff-xs-perl libalgorithm-merge-perl
libclick-0.4-0 libcwidget3 libdistro-info-perl libept1.4.12 libexporter-lite-perl libio-stringy-perl liblttng-ust-ctl2 liblttng-ust0 libparse-debcontrol-perl
libupstart-app-launch2 liburcu1 libxdelta2 pbuilder pbzip2 pristine-tar pybootchartgui python-bzrlib python-configobj python-debianbts python-distro-info python-dns
python-fpconst python-keyring python-launchpadlib python-lazr.restfulclient python-lazr.uri python-lzma python-oauth python-reportbug python-secretstorage
RAILS_ENV=production rake db:setup
# produces the error below.....hmmm.....it's a no-worky
psql:/yourprojectpath/yourproject/db/structure.sql:29: ERROR: could not open extension control file "/usr/share/postgresql/9.1/extension/hstore.control": No such file or directory
# hstore postgresql extension needs to be installed, so....
sudo apt-get install postgresql-contrib
# now your extension should be available to enable so log in with psql
psql -d yourproject_production -U yourdbuser -W