Skip to content

Instantly share code, notes, and snippets.

View johnpaulashenfelter's full-sized avatar

John Paul Ashenfelter johnpaulashenfelter

View GitHub Profile
@johnpaulashenfelter
johnpaulashenfelter / dollar.rb
Created July 18, 2022 11:39 — forked from JoelQ/dollar.rb
Implementing value object semantics as an RSpec shared_example.
class Dollar
attr_reader :cents
def initialize(cents:)
@cents = cents
end
def hash
[self.class, cents].hash
end
@johnpaulashenfelter
johnpaulashenfelter / RunAProxyOnAmazonEC2VPC.md
Created November 30, 2017 14:04 — forked from webinista/RunAProxyOnAmazonEC2VPC.md
Create a proxy server on an Amazon EC2 (VPC) instance

This will create a proxy server in whatever your availability zone your VPC is in. For me, that's us-east-1b. For you, that may be something different. Steps 10+ should more or less work regardless of your provider since those steps cover the setup and configuration of TinyProxy.

  1. Click the Launch Instance button.
  2. Choose Ubuntu Server 14.04 LTS (HVM), SSD Volume Type. This isn't strictly necessary. If you choose another OS, check its documentation for how to install new packages.
  3. On the Choose an Instance Type screen, select t2.micro. It's Free Tier eligible.
  4. Click the Next: ... buttons until you reach the Configure Security Group screen.
    • You may wish to reduce the amount of storage on the Add Storage screen. This is optional.
    • You may wish to add a tag on the Tag Instance screen. This is also optional.
  5. On the Configure Security Group screen:
  • Select Create a new security group.
@johnpaulashenfelter
johnpaulashenfelter / application.rb
Created October 19, 2017 11:13 — forked from shawndrost/application.rb
Single file Rails application
# the new and improved one-file rails app -- now including
require "action_controller/railtie"
class Tester < Rails::Application
config.session_store :cookie_store, :key => '_rails_session'
config.secret_token = '095f674153982a9ce59914b561f4522a'
end
class UsersController < ActionController::Base
@johnpaulashenfelter
johnpaulashenfelter / ladder.md
Created June 20, 2017 11:24 — forked from jamtur01/ladder.md
Kickstarter Engineering Ladder
@johnpaulashenfelter
johnpaulashenfelter / Unicode table
Created August 29, 2016 16:46 — forked from ivandrofly/Unicode table
Unicode table - List of most common Unicode characters *
Unicode table - List of most common Unicode characters *
* This summary list contains about 2000 characters for most common ocidental/latin languages and most printable symbols but not chinese, japanese, arab, archaic and some unprintable.
Contains character codes in HEX (hexadecimal), decimal number, name/description and corresponding printable symbol.
What is Unicode?
Unicode is a standard created to define letters of all languages ​​and characters such as punctuation and technical symbols. Today, UNICODE (UTF-8) is the most used character set encoding (used by almost 70% of websites, in 2013). The second most used character set is ISO-8859-1 (about 20% of websites), but this old encoding format is being replaced by Unicode.
How to identify the Unicode number for a character?
Type or paste a character:

Contract Killer

The popular open-source contract for web designers and developers by Stuff & Nonsense

  • Originally published: 23/12/2008
  • Revised date: 15/12/2013
  • Original post

group :production do
gem 'unicorn'
# Enable gzip compression on heroku, but don't compress images.
gem 'heroku-deflater'
# Heroku injects it if it's not in there already
gem 'rails_12factor'
end
@johnpaulashenfelter
johnpaulashenfelter / index.html
Created October 19, 2012 13:16 — forked from dfm/LICENSE
XKCD-style plots in d3
<!DOCTYPE HTML>
<html>
<head>
<title>XKCD plots in d3</title>
<script src="http://d3js.org/d3.v2.min.js?2.10.0"></script>
<script src="xkcd.js"></script>
<style>
@johnpaulashenfelter
johnpaulashenfelter / data.csv
Created December 9, 2011 01:07 — forked from clr/data.csv
Planet Finder RubyGames
Life DistanceWithin3AU TempUnder375 Water Atmosphere ClassM GasGiant
0 0 0 0 1 0 1
0 1 1 0 1 0 0
0 1 0 0 0 0 0
0 0 0 0 1 0 0
0 1 0 0 1 0 1
0 1 0 1 0 0 1
0 1 1 0 1 0 1
1 0 1 1 1 0 0
0 1 0 0 1 0 1