Skip to content

Instantly share code, notes, and snippets.

@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

@SteveBenner
SteveBenner / _color-palette.slim
Created October 29, 2015 14:32
Slim partial - renders a color palette on your web page to aid in graphic design
/ This is a humble web design tool inspired by the eyedropper functionality in Google Chrome's
color picker interface (part of the dev tools panel) which allows one to choose any pixel of
the current web page to set as a color property's value. Though hugely convenient for visual
design, color selection being limited to the context of the page leaves much to be desired.
/ This partial solves the limitation by affixing an unobtrusive panel to your page to act as
a makeshift color palette to use in conjunction with the eyedropper. The panel is populated
with small squares representing a list of colors passed into the partial via local. Viola!
/ @local [Array<String>] colors List of values valid for `background-color` CSS property
@SteveBenner
SteveBenner / dl-tatw.rb
Created May 17, 2015 16:48
Web scraper that downloads archived episodes of 'Trance Around The World' podcast
#!/usr/bin/env ruby
#
# This is a web scraper which downloads mp3 files from the TATW web archives.
#
# Usage: run this script and pass it an episode range to download via arguments
#
# Dependencies: requires 'aria2' to be installed (uses the CLI tool 'aria2c')
#
require 'pathname'
require 'colorize' # Use of this gem is optional; it makes the output prettier
@SteveBenner
SteveBenner / gh-starred.rb
Created March 15, 2015 09:46
Produce a Markdown file enumerating the starred repos of a GitHub user (with HTML links) using the Unicorn API gem
# The 'github_api' gem is implicility assumed to have been loaded at this point...
# Configuration data is passed to Github::Client#new as a Hash whose keys are Symbols
CONFIG_DATA = {
user: 'github-username',
login: '[email protected]',
oauth_token: 'personal-access-token' # one of many valid authentication methods (see the gem docs for more)
}
# Data is returned from the API as a Github::ResponseWrapper object
@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 / flatdoc.slim
Last active October 5, 2016 14:27
Slim template for Flatdoc
/ This is a Slim recreation of the Flatdoc example template provided here:
/ https://raw.githubusercontent.com/rstacruz/flatdoc/gh-pages/templates/template.html
/
/ Flatdoc is a simple way to generate a documentation page from Markdown
/ More info is available on their website: http://ricostacruz.com/flatdoc/
/
/ The main alterations noticeable in this version of the template are:
/ - Emphasis is placed on using variables and interpolation often, key advantages of Slim
/ - The GitHub button links have been replaced with a Web Component version, which I
find to be superior to using an iFrame. Just uncomment the original code to revert.
@SteveBenner
SteveBenner / regexes.md
Last active August 29, 2015 14:09
Useful Regular Expressions I’ve come up with

Regular Expressions

Text coloring / highlighting

I use the following regexes with [iTerm2][iterm]'s ['trigger' feature][it1] to create some basic syntax highlighting.

(?<=- )([A-Z][A-Z ]+:)+ Colorize CONSTANTS Magenta
(?<=- )(:|")\w*"?(?= =>) Colorize :keys => / "keys" => Yellow
^([^=]*)(?==) Colorize ENV_VARS Cyan
(?&lt;=[^=])= Colorize the = separator Dark Grey

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;
/ 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"