Skip to content

Instantly share code, notes, and snippets.

View jpinnix's full-sized avatar

Jeremy Pinnix jpinnix

View GitHub Profile
@jpinnix
jpinnix / image.rb
Created August 12, 2010 19:29 — forked from bhauman/image.rb
Paperclip set width and height of an image
class Image < ActiveRecord::Base
before_create, :set_width_and_height
has_attached_file :img,
:url => "/system/images/:attachment/:id/:basename.:extension",
:path => "#{Rails.root}/public/system/images/:attachment/:id/:basename.:extension"
def set_width_and_height
# this next line is the magic line
geo = Paperclip::Geometry.from_file(img.to_file(:original))
App details:
Rails 3.0.0
Bundler 1.0
http://github.com/challengepost/postmark-rails (fork for Rails 3)
Ran bundle install, everything installed correctly. Checked in Gemfile.lock and
added 'require "bundler/capistrano"' to deploy.rb. Works totally fine on local.
But on deploy it locks up when trying to init submodules:
No submodule mapping found in .gitmodules for path
@jpinnix
jpinnix / gist:821880
Created February 11, 2011 03:32
Janus install problem
rake --trace
(in /Users/jpinnix/.vim)
** Invoke default (first_time)
** Invoke ack.vim (first_time)
** Execute ack.vim
****************************************
* Installing ack.vim *
****************************************
User john:
ssh john@common-machine
screen -S pairprog
Ctrl-a :multiuser on
Ctrl-a :acladd pete
User pete:
@jpinnix
jpinnix / gist:3079197
Created July 9, 2012 21:43
Install MySQL on Lion using Homebrew
$ brew update
$ brew install mysql
$ mysql_install_db --verbose --basedir="$(brew --prefix mysql)" --datadir=/usr/local/var/mysql --tmpdir=/tmp
$ mkdir -p ~/Library/LaunchAgents
$ cp /usr/local/Cellar/mysql/5.5.25a/homebrew.mxcl.mysql.plist ~/Library/LaunchAgents/
$ launchctl load -w ~/Library/LaunchAgents/homebrew.mxcl.mysql.plist
$ mysql -uroot
@jpinnix
jpinnix / gist:3079208
Created July 9, 2012 21:46
Installing Nokogiri on Lion using Homebrew
# From http://nokogiri.org/tutorials/installing_nokogiri.html#mac_os_x
$ brew update
$ brew install libxml2 libxslt
$ brew link libxml2 libxslt
$ wget http://ftp.gnu.org/pub/gnu/libiconv/libiconv-1.13.1.tar.gz
$ tar xvfz libiconv-1.13.1.tar.gz
$ cd libiconv-1.13.1
$ ./configure --prefix=/usr/local/Cellar/libiconv/1.13.1
$ make
@jpinnix
jpinnix / styles.less
Created February 18, 2016 22:03 — forked from brandondurham/styles.less
Using Operator Mono in Atom
/**
* Using Operator Mono in Atom
*
* 1. Open up Atom Preferences.
* 2. Click the “Open Config Folder” button.
* 3. In the new window’s tree view on the left you should see a file called “styles.less”. Open that up.
* 4. Copy and paste the CSS below into that file. As long as you have Operator Mono SSm installed you should be golden!
* 5. Tweak away.
*
* Theme from the screenshot (http://cdn.typography.com/assets/images/blog/operator_ide2.png):
@jpinnix
jpinnix / gist:3186304
Created July 27, 2012 05:25
Installing Ruby 1.8.7-p358 with rbenv on Mountain Lion
Follow the instructions here: The Hitchhiker's Guide to Riding a
Mountain Lion http://j.mp/Qm5UJD, including installing XQuartz.
After installing XQuartz set the correct path to the X11 library to
install Ruby 1.8.7-p358 with rbenv:
export CPPFLAGS=-I/opt/X11/include
then let the compiler know where gcc-4.2 is:
@jpinnix
jpinnix / export_pinboard.py
Created March 23, 2017 22:10 — forked from dlo/export_pinboard.py
Export all Pinboard.in bookmarks with a specific tag.
#!/usr/bin/env python
"""
This script is designed to generate a simple HTML file with _all_ of your
Pinboard.in bookmarks.
You should edit the `username`, `password`, `bookmark_filename`, and `tag`
variables.
Requirements:

Keybase proof

I hereby claim:

  • I am jpinnix on github.
  • I am jpinnix (https://keybase.io/jpinnix) on keybase.
  • I have a public key ASDPw031JHh1g-xUF2MOinTs89eie086s-PdtV-3cEx6zgo

To claim this, I am signing this object: