Skip to content

Instantly share code, notes, and snippets.

View jdickey's full-sized avatar
💭
Open to possibilities. Enquire within.

Jeff Dickey jdickey

💭
Open to possibilities. Enquire within.
View GitHub Profile
@fluxrad
fluxrad / Dockerfile
Created September 22, 2014 19:21
Dockerfile for a basic rbenv + rails environment
# Inspired by Deepak's setup here - https://gist.github.com/deepak/5925003
FROM ubuntu:14.04
RUN apt-get update -qq && apt-get install -y build-essential nodejs npm git curl mysql-client libmysqlclient-dev
RUN mkdir -p /my_awesome_social_media_app
# Install rbenv
RUN git clone https://github.com/sstephenson/rbenv.git /usr/local/rbenv
RUN echo '# rbenv setup' > /etc/profile.d/rbenv.sh
@grugq
grugq / gist:03167bed45e774551155
Last active April 6, 2024 10:12
operational pgp - draft

Operational PGP

This is a guide on how to email securely.

There are many guides on how to install and use PGP to encrypt email. This is not one of them. This is a guide on secure communication using email with PGP encryption. If you are not familiar with PGP, please read another guide first. If you are comfortable using PGP to encrypt and decrypt emails, this guide will raise your security to the next level.

@jacrook
jacrook / font_variables.scss
Last active July 2, 2023 16:47
Sass Css Font Stack Variables
//////////////////////////////////////////////////////////////
// Font Variables (http://cssfontstack.com/)
//////////////////////////////////////////////////////////////
//
// Serif font-stacks
//
$baskerville-font-stack: "Big Caslon", "Book Antiqua", "Palatino Linotype", Georgia, serif !default;
module LoadResources
module ClassMethods
def load_resource(resource_class, options = {})
filter_options = options.slice :only, :except, :if, :unless
resource_options = options.except :only, :except, :if, :unless
send(:before_filter, filter_options) do |controller|
ResourceBuilder.new(controller, resource_class, resource_options)
.send(:load_resource)
end
@spilth
spilth / ruby-rails-resources.md
Last active December 1, 2016 12:40
A collection of useful reference and learning resources for Ruby and Rails.
@josevalim
josevalim / 0_README.md
Created September 13, 2012 21:52
Sinatra like routes in Rails controllers

Sinatra like routes in Rails controllers

A proof of concept of having Sinatra like routes inside your controllers.

How to use

Since the router is gone, feel free to remove config/routes.rb. Then add the file below to lib/action_controller/inline_routes.rb inside your app.

@ream88
ream88 / response_matchers.rb
Created July 21, 2012 10:16
minitest-matchers for controller/functional specs
# Simple minitest matchers which will make your controller/functional specs less pain in the ass.
#
# ==== Dependencies
#
# gem 'minitest'
# gem 'minitest-matchers'
#
# ==== Matchers
#
# +must_have_status+ and its opposite +wont_have_status+ take both one argument which must be one of the following:
@jumski
jumski / enumerize_matcher.rb
Created April 6, 2012 10:58
Rspec matcher for enumerize gem
# RSpec matcher to spec enumerize settings
# usage:
#
# it { should enumerize(:sex).in(:male, :female).with_default(:male) }
RSpec::Matchers.define :enumerize do |attribute|
match do |model|
@attribute = attribute
@klass = model.class
@bgentry
bgentry / sequel_paranoia.rb
Created November 30, 2011 03:20
Sequel Paranoia plugin (i.e. acts_as_paranoid)
module Sequel
module Plugins
# The paranoia plugin creates hooks that automatically set deleted
# timestamp fields. The field name used is configurable, and you
# can also set whether to overwrite existing deleted timestamps (false
# by default). Adapted from Timestamps plugin.
#
# Usage:
#
# # Soft deletion for all model instances using +deleted_at+
@kennym
kennym / blogspot_to_jekyll.rb
Created July 30, 2011 18:14
Migrate your blogger blog posts to jekyll.
#!/usr/bin/env ruby
#
# Convert blogger (blogspot) posts to jekyll posts
#
# Basic Usage
# -----------
#
# ./blogger_to_jekyll.rb feed_url
#
# where `feed_url` can have the following format: