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
# ~/.ssh/config
```
Include conf.d/*
Host *
AddKeysToAgent yes
UseKeychain yes
IdentityFile ~/.ssh/id_rsa
```
@johnpaulashenfelter
johnpaulashenfelter / README.md
Last active July 25, 2018 02:05
Quick pairing exercise

Database Server Pairing Exercise

This pairing task was chosen from https://www.recurse.com/pairing-tasks

Initial task

Before your interview, write a program that runs a server that is accessible on http://localhost:4000/. When your server receives a request on http://localhost:4000/set?somekey=somevalue it should store the passed key and value in memory. When it receives a request on http://localhost:4000/get?key=somekey it should return the value stored at somekey.

During your interview, you will pair on saving the data to a file. You can start with simply appending each write to the file, and work on making it more efficient if you have time.

@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
Twelve Things This Book Will Do For You
# This section was included in the original 1936 edition as a single page list, which preceded the main content of the book, showing a prospective reader what to expect from it. The 1981 edition omits points 6 to 8 and 11.
# Get you out of a mental rut, give you new thoughts, new visions, new ambitions.
# Enable you to make friends quickly and easily.
# Increase your popularity.
# Help you to win people to your way of thinking.
# Increase your influence, your prestige, your ability to get things done.
# Enable you to win new clients, new customers.
# Increase your earning power.
@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:
@johnpaulashenfelter
johnpaulashenfelter / languages.md
Last active August 29, 2015 14:10
Languages I've been paid to write code
  1. MS VisualBasic 1.0, 3.0, 4.0, 6.0
  2. Matlab
  3. MS VisualBasic for DOS
  4. Fortran
  5. Authorware (CD applications)
  6. ActionScript
  7. ASP2.0 (with JScript instead of VBScript)
  8. MS VBA + MS Project + MS-SQL Server (weird crazy app hybrid thing)
  9. MS Access
  10. Java (EJB/servlets, applets)

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