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: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

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

Pagination 101

Article by Faruk Ateş, [originally on KuraFire.net][original] which is currently down

One of the most commonly overlooked and under-refined elements of a website is its pagination controls. In many cases, these are treated as an afterthought. I rarely come across a website that has decent pagination, and it always makes me wonder why so few manage to get it right. After all, I'd say that pagination is pretty easy to get right. Alas, that doesn't seem the case, so after encouragement from Chris Messina on Flickr I decided to write my Pagination 101, hopefully it'll give you some clues as to what makes good pagination.

Before going into analyzing good and bad pagination, I want to explain just what I consider to be pagination: Pagination is any kind of control system that lets the user browse through pages of search results, archives, or any other kind of continued content. Search results are the o

If you had problems to use the gem therubyracer on Ubuntu 12.04LTS after install
$gem install therubyracer
You just need to delete v8 library before install therubyracer, so...
$gem uninstall libv8
$gem install therubyracer
ok... if you did that and the rails still asking "Please install gem therubyracer", don't worry. Just edit the gemfile:
@jrgifford
jrgifford / init.pp
Created March 19, 2013 14:16 — forked from loe/init.pp
class rsyslog {
include logrotate::rsyslog
package { 'rsyslog':
ensure => installed
}
service { 'rsyslog':
ensure => running
}
@jrgifford
jrgifford / error.txt
Last active December 13, 2015 23:59 — forked from jarib/file.rb
Selenium::WebDriver::Error::WebDriverError: unable to obtain stable firefox connection in 60 seconds (127.0.0.1:7055)
from /home/jrg/.rbenv/versions/1.9.3-p385/lib/ruby/gems/1.9.1/gems/selenium-webdriver-2.29.0/lib/selenium/webdriver/firefox/launcher.rb:79:in `connect_until_stable'
from /home/jrg/.rbenv/versions/1.9.3-p385/lib/ruby/gems/1.9.1/gems/selenium-webdriver-2.29.0/lib/selenium/webdriver/firefox/launcher.rb:37:in `block in launch'
from /home/jrg/.rbenv/versions/1.9.3-p385/lib/ruby/gems/1.9.1/gems/selenium-webdriver-2.29.0/lib/selenium/webdriver/firefox/socket_lock.rb:20:in `locked'
from /home/jrg/.rbenv/versions/1.9.3-p385/lib/ruby/gems/1.9.1/gems/selenium-webdriver-2.29.0/lib/selenium/webdriver/firefox/launcher.rb:32:in `launch'
from /home/jrg/.rbenv/versions/1.9.3-p385/lib/ruby/gems/1.9.1/gems/selenium-webdriver-2.29.0/lib/selenium/webdriver/firefox/bridge.rb:20:in `initialize'
from /home/jrg/.rbenv/versions/1.9.3-p385/lib/ruby/gems/1.9.1/gems/selenium
@jrgifford
jrgifford / gist:4424175
Last active December 10, 2015 10:58 — forked from anonymous/gist:4424170
callback(
[
{ "name": "[Q]Really a bug ", "description": "This question should instead be filed as a bug report, and <a href=\"http://meta.askubuntu.com/questions/1317/what-to-do-with-questions-that-describe-known-bugs/\">as such</a> is off-topic, thanks! <a href=\"http://askubuntu.com/questions/5121/how-do-i-report-a-bug\">Instructions on filing a bug report are here</a>."},
{ "name": "[Q]Hardware ", "description": "We need more hardware information to help you, can you look at <a href=\"http://askubuntu.com/questions/14008/i-have-a-hardware-detection-problem-what-logs-do-i-need-to-look-into\">this question</a> and then edit your question adding the information."},
{ "name": "[A]OP adding a new question as an answer ", "description": "If you have another question, please ask it by clicking the <a href=\"http://askubuntu.com/questions/ask\">Ask Question</a> button."},
#!/bin/sh
echo "When prompted to, please enter in your password."
sudo cp /System/Library/Frameworks/ApplicationServices.framework/Versions/A/Frameworks/PrintCore.framework/Versions/A/Resources/GenericPrinter.ppd /usr/share/cups/model/GenericPrinter.ppd
sudo lpadmin -p Canon_D1170 -E -v http://192.168.100.241:631/printers/Canon_D1170 -m GenericPrinter.ppd
echo "All done! You can now print to the Canon from this computer"
echo "You can now close this window."
@jrgifford
jrgifford / american _why
Created October 3, 2012 21:29 — forked from netshade/american _why
_catch the lucky whiff's tribute to _why
A long, long time ago...
I can still remember
How his blog used to make me smile.
And I knew that if he had his chance
That he could make their code enhance
And, maybe, they’d be happy for a while.
But August made me shiver
With every code line I’d deliver.
Bad news on the doorstep;
h = Hash.new
f = File.open('numbers.csv', "r")
f.each_line { |line|
numbers = line.split
numbers.each { |w|
if h.has_key?(w)
h[w] = h[w] + 1
else
h[w] = 1
end