Skip to content

Instantly share code, notes, and snippets.

@SteveBenner
SteveBenner / pry-cheatsheet.md
Last active April 23, 2022 18:28 — forked from lfender6445/gist:9919357
Pry cheat sheet

Pry Cheat Sheet

Youtube Tutorial (2013)

Command Line

  • pry -r ./config/app_init_file.rb -- load your app into a pry session (look at the file loaded by config.ru)
  • pry -r ./config/environment.rb -- load your rails into a pry session

Debugger

@SteveBenner
SteveBenner / brewfix1-osxfuse.rb
Last active April 4, 2022 22:47 — forked from yiufung/truecrypt_fix.bash
Homebrew fix - unexpected files and libs from ‘osxfuse'
#!/usr/bin/env ruby
#
# Homebrew fix 1 - osxfuse dylibs
#
# original solutions: https://gist.github.com/aaronzirbes/3239033
# https://gist.github.com/trinitronx/5437061
#
# Fixes the following:
#
# > Warning: Unbrewed dylibs were found in /usr/local/lib.
@SteveBenner
SteveBenner / load-jQuery.js
Created August 7, 2020 17:35 — forked from takkyuuplayer/load-jQuery.js
use jQuery in Chrome javascript console.
var jq = document.createElement('script');
jq.src = "//ajax.googleapis.com/ajax/libs/jquery/1.10.1/jquery.min.js";
document.getElementsByTagName('head')[0].appendChild(jq);
jQuery.noConflict();
@SteveBenner
SteveBenner / README-Template.md
Created July 28, 2017 04:57 — forked from PurpleBooth/README-Template.md
A template to make good README.md

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

Prerequisites

/ This partial allows you to render the Coderwall badges of specified user
/
ruby:
username = 'your-coderwall-username'
orientation = 'horizontal' # can be 'vertical' or 'horizontal'
/ Place the following tags in the HEAD section of your web page (omit jQuery if already present, of course)
link href="http://coderwall.com/stylesheets/jquery.coderwall.css" media="all" rel="stylesheet" type="text/css"
script src="https://code.jquery.com/jquery-2.1.1.min.js"
script src="http://coderwall.com/javascripts/jquery.coderwall.js"
@SteveBenner
SteveBenner / sitemap.xml.slim
Last active April 24, 2016 12:01 — forked from ls-lukebowerman/sitemap.xml.erb
Slim template - generates a sitemap for Middleman
- pages = sitemap.resources.find_all{|p| p.source_file.match(/\.html/) }
doctype xml
urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"
- pages.each do |p|
url
loc "http://www.YOUR_WEBSITE_URL/#{p.destination_path.gsub('/index.html','')}"
lastmod = Date.today.to_time.iso8601
changefreq = p.data.changefreq || 'weekly'
priority = p.data.priority || '0.5'
body.loading:after {
/* with no content, nothing is rendered */
content: "";
position: fixed;
/* element stretched to cover during rotation an aspect ratio up to 1/10 */
top: -500%;
left: -500%;
right: -500%;
bottom: -500%;
z-index: 9999;
@SteveBenner
SteveBenner / _disqus.slim
Last active August 29, 2015 13:59 — forked from voigt/disqus.js
Slim partial - Disqus comments widget
/ Integrate Disqus comments into your site with this widget (adheres to official API and config spec)
/
/ @see https://help.disqus.com/customer/portal/articles/1104788-web-integration Official web integration docs
/ @see https://help.disqus.com/customer/portal/articles/472098-javascript-configuration-variables Configuration docs
/
/ @local [Hash{Symbol => String}] disqus Key/value pairs corresponding to the Disqus JS configuration variables
/ @option disqus [String] shortname Unique identifier for your forum website registered on Disqus.com (REQUIRED)
/ @option disqus [String] identifier A String or Integer value which identifies the current web page thread
/ @option disqus [String] title Title of the current page; defaults to value of HTML `title` element
/ @option disqus [String] url URL of the current page; defaults to `window.location.href`