Skip to content

Instantly share code, notes, and snippets.

@jamiew
jamiew / Procfile
Last active October 4, 2015 12:28
Using unicorn on Heroku
web: bundle exec unicorn -p $PORT -c ./config/unicorn.rb
require 'json'
require 'pry'
require 'csv'
require 'open-uri'
def parse_movie_data(data)
JSON.parse(data)
end
def populate_csv(movies, filename)
@pdarden
pdarden / SeeingIsBelievingInstruction.md
Last active March 21, 2016 02:23
How to setup SeeingIsBelieving Plugin for Sublime Text/RVM/OS X

Integration of seeing_is_believing to sublime text 2/3 as a plugin with RVM on OS X.

In Terminal

  1. $ rvm 2.0.0@sublime-text-2 --create or for ST-3 $ rvm 2.0.0@sublime-text-3 --create
  2. $ gem install seeing_is_believing
  3. $ cd ~/Library/Application\ Support/Sublime\ Text\ 2/Packages or for ST-3 $ cd ~/Library/Application\ Support/Sublime\ Text\ 3/Packages
  4. git clone git://github.com/JoshCheek/sublime-text-2-seeing-is-believing.git SeeingIsBelieving
  5. $ rvm wrapper 2.0.0@sublime-text-2 sublime or for ST-3 $ rvm wrapper 2.0.0@sublime-text-3 sublime

Inquiries Walkthrough

We're asked to build an application that allows a user to submit inquiries. The user stories come in two parts. In the first part, we create a simple form with text inputs to capture an inquiry. In the second part, we're asked to categorize the inquiries that are submitted.

We will build to the first story and then turn our attention to the second once our tests are passing.

User Stories

Submit an inquiry

@wannabefro
wannabefro / sublimetips.md
Created November 12, 2013 22:00
sublime stuff

Sublime Text Tips & Tricks

Command P || Command T

Press Command + T or Command + P, type in the name of the file you wish to access (fuzzy finder), and, without even pressing Enter, you’ll instantly be transported to that file.

Shift Command P

We can use Sublime’s command palette by accessing the Tools menu, or by pressing Shift + Command + P, on the Mac.

Whether you need to visit a Preferences page, or paste in a snippet, all of that can be accomplished here.

@RyanMcG
RyanMcG / rails-pre-commit
Last active August 1, 2018 17:05
A pre-commit hook for rails projects that scans for 'binding.pry', 'debugger' and diff artifacts and stops the commit if it finds any.
#!/bin/sh
COMMAND='git grep -n --cached'
ARGS='-e debugger -e "binding\.pry" -- app config db spec vendor script lib Rakefile Guardfile Capfile'
if eval "$COMMAND -q $ARGS" ; then
echo "You have a binding.pry or a debugger in a bad place.\n"
eval "$COMMAND $ARGS"
exit 1
fi
@odlp
odlp / update.sh
Last active May 3, 2020 10:06
Rbenv update Rubygems
#!/usr/bin/env sh
# Multiple vulnerabilities have been disclosed in RubyGems:
# https://www.ruby-lang.org/en/news/2018/02/17/multiple-vulnerabilities-in-rubygems/
#
# And again in March 2019:
# https://blog.rubygems.org/2019/03/05/security-advisories-2019-03.html
#
# If you're an Rbenv user, here's any easy one-liner to upgrade to a
# safe version of Rubygems (2.7.8 / 3.0.3 or later) for each installed Ruby version:
@kneath
kneath / Guide.md
Created June 8, 2014 01:16
FoldingText 2.0's User Guide

Welcome to the User's Guide

Remember, it's all just text.

FoldingText does some neat things, but in the end you are just typing. If you know how to type, you already know most of what you need to effectively use FoldingText.

(Click "#" to expand headings)


@timwco
timwco / delete.md
Last active July 20, 2023 15:59
LinkedIn: Delete Messages (June 2022)

What

LinkedIn is a valuable resource, but sometimes it sucks. One of those times is when you want to delete messages. You have to select each message one by one. It takes about 4 "clicks" to successfully delete a message.

This script should help. Since LI requires you to perform multiple steps, I decided to automate it for you. Once you initiate the script, it will run every second. If a message has the ability to be deleted, it will be. If not, it will be archived. Some "InMail" messages cannot be deleted on the web app. This script should work as long as LI doesn't change their page layout or element names, which happens often.

Last tested & verified working on: June, 10, 2022

Special Thanks to @noncent for the updated script.

@marcedwards
marcedwards / high-dpi-media.css
Last active November 19, 2023 12:56
A CSS media query that captures almost all high DPI aware devices.
/* ---------------------------------------------------------- */
/* */
/* A media query that captures: */
/* */
/* - Retina iOS devices */
/* - Retina Macs running Safari */
/* - High DPI Windows PCs running IE 8 and above */
/* - Low DPI Windows PCs running IE, zoomed in */
/* - Low DPI Windows PCs and Macs running Firefox, zoomed in */
/* - Android hdpi devices and above */