Skip to content

Instantly share code, notes, and snippets.

@briankung
briankung / docker-pry-rails.md
Last active December 12, 2023 10:40
Using pry-rails with Docker

First, add pry-rails to your Gemfile:
https://github.com/rweng/pry-rails

gem 'pry-rails', group: :development

Then you'll want to rebuild your Docker container to install the gems

@devonzuegel
devonzuegel / .pryrc
Last active August 7, 2023 06:16
My .pryrc file
# === EDITOR ===
Pry.editor = 'vi'
require 'awesome_print'
# == Pry-Nav - Using pry as a debugger ==
Pry.commands.alias_command 'c', 'continue' rescue nil
Pry.commands.alias_command 's', 'step' rescue nil
Pry.commands.alias_command 'n', 'next' rescue nil
# === CUSTOM PROMPT ===
@ryanb
ryanb / development.rb
Created November 27, 2012 21:38
Some rack middleware to add headers to asset pipeline.
class AssetHeaders
def initialize(app)
@app = app
end
def call(env)
request = Rack::Request.new(env)
response = @app.call(env)
if request.path =~ /^\/assets\//
# there maybe a better way to add headers
@jashkenas
jashkenas / minified-single-line-bookmarket.js
Created October 27, 2010 19:06
Handy Bookmarklet to recursively reload all CSS stylesheets for each frame in the page.
(function(){function f(b){b=b||window;for(var g=b.document.getElementsByTagName("link"),a=0,d=g.length;a<d;a++){var e=g[a],c=e.href;if(c&&/stylesheet/i.test(e.rel)){c=c.replace(/(&|%5C?)forceReload=\d+/,"");var h="forceReload="+(new Date).valueOf();e.href=c+(c.indexOf("?")>=0?"&":"?")+h}}a=0;for(d=b.frames.length;a<d;a++)f(b.frames[a])}f()})();
@mikelikespie
mikelikespie / refresh_css.js
Created October 27, 2010 18:31
This refreshes all the css on a page by changing the query string
/*
Add a bookmark to this
javascript:(function(){var c=document.getElementsByTagName("link");for(var d=0;d<c.length;d++){var a=c[d];if(a.rel=='stylesheet'||a.type=="text/css"){var e="css_buster_"+Math.floor(Math.random()*1000000000);var g=a.href.split("?",2);var f;if(g.length>1){var b=g[1].indexOf("&")==-1;if(b){f=e}else{f=g[1]+"&"+e}}else{f=e}a.href=g[0]+"?"+f}}})();
*/
(function() {
var links = document.getElementsByTagName('link');
for (var i = 0; i < links.length; i++) {
var l = links[i];
if (l.rel == 'stylesheet' || l.type == 'text/css') {