Skip to content

Instantly share code, notes, and snippets.

Recognized HTTParty parameters:
Class Foo
include HTTParty
http_proxy '<URL>', <PORT> # Allows setting http proxy information to be used
base_uri '<URL>' # Allows setting a base uri to be used for each request. Will normalize uri to include http, etc.
basic_auth '<USERNAME>', '<PASS>' # Allows setting basic authentication username and password.
digest_auth '<USERNAME>', '<PASS>' # Allows setting digest authentication username and password.
default_params <Default_Param_Hash> # Allows setting default parameters to be appended to each request. Great for api keys and such.
@assimovt
assimovt / new.html
Created August 20, 2011 17:28
Refactor Rails application layout to use HTML5 semantics with HAML
<!DOCTYPE html>
<!-- paulirish.com/2008/conditional-stylesheets-vs-css-hacks-answer-neither/ -->
<!--[if lt IE 7]> <html class="no-js ie6 oldie" lang="en"> <![endif]-->
<!--[if IE 7]> <html class="no-js ie7 oldie" lang="en"> <![endif]-->
<!--[if IE 8]> <html class="no-js ie8 oldie" lang="en"> <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js" lang="en"> <!--<![endif]-->
<head>
<meta charset='utf-8'>
@chetan
chetan / yardoc_cheatsheet.md
Last active May 10, 2024 02:53
YARD cheatsheet
@terryjray
terryjray / gist:3296171
Created August 8, 2012 15:55
Enabling hstore for new postgresql 9.1 and rails 3 install on ubuntu 12.04
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
@rvagg
rvagg / README.md
Last active July 19, 2024 07:32
Kindleberry "Paperwhite" Pi

Work in progress, I'll write this up properly when I'm done.

Almost all credit goes to @maxogden for putting me on to this and pointing me in the right direction for each of these items.

Prerequisites:

  • Raspberry Pi
  • Kindle Paperwhite freed from its locked down state (jailbroken) http://www.mobileread.com/forums/showthread.php?t=198446
    • You have to downgrade your Kindle to 5.3.1 to install the current jailbreak; that's just a matter of getting the old version image, putting it on your Kindle via USB and telling it to install "upgrade". Then you put in the Jailbreak files, load the ebook and break.
  • Your kindle will be quick to detect an upgrade is available so it'll want to upgrade soon afterwards but the jailbreak will last but you have to reinstall the developer certificates so it's a bit of a pain but doable. Find all the instructions on the mobileread.com forums and wiki.
@gongo
gongo / Gemfile
Last active February 14, 2018 22:14
Capybara の稼働状況を animation gif として保存するようなやつ
source 'https://rubygems.org'
gem 'capybara'
gem 'rake'
gem 'selenium-webdriver'
gem 'json'
gem 'rmagick'
@mattbrictson
mattbrictson / application.html.erb
Last active August 16, 2023 15:33
Simpler nested layouts in Rails using the parent_layout helper
<%= render("shared/navbar") %>
<div class="container">
<%= render("shared/alerts") %>
<%= render("shared/page_header") %>
<%= yield %>
<%= render("shared/footer") %>
@israelb
israelb / 00-100-colours.gif
Created November 30, 2015 17:24 — forked from grough/00-100-colours.gif
Generate animated gif with ruby + rmagick
00-100-colours.gif
@fdietz
fdietz / .dockerignore
Created April 7, 2021 18:20
Rails Docker Compose Setup for local development
.DS_Store
.bin
.git
.gitignore
.bundleignore
.bundle
.byebug_history
.rspec
tmp
log