Skip to content

Instantly share code, notes, and snippets.

View kerrizor's full-sized avatar
🏍️
BRAAAAAAAAP!

Kerri Miller kerrizor

🏍️
BRAAAAAAAAP!
View GitHub Profile
module Rack
class Request
def scheme
if @env['HTTPS'] == 'on'
'https'
elsif @env['HTTP_X_FORWARDED_SSL'] == 'on'
'https'
elsif @env['HTTP_X_FORWARDED_PROTO']
@env['HTTP_X_FORWARDED_PROTO'].split(',')[0]
else
@jimbojsb
jimbojsb / gist:1630790
Created January 18, 2012 03:52
Code highlighting for Keynote presentations

Step 0:

Get Homebrew installed on your mac if you don't already have it

Step 1:

Install highlight. "brew install highlight". (This brings down Lua and Boost as well)

Step 2:

@avdi
avdi / gist:3842243
Created October 5, 2012 20:38
Observer pattern terminology

When it comes to the Observer pattern, there are a number of related, overlapping terms used by different codebases. Off the top of my head:

  • Observer/Observable/Subject
  • Listener/Listenable
  • Event/Event source/Event sink/Event handler
  • Hook/Callback
  • Subscriber/Subscribable
  • "Firing" vs. "Triggering" vs "Notifying" vs "Executing"

Which of these do consider to be synonymous?

@steveklabnik
steveklabnik / reading.md
Last active April 11, 2016 11:26
intro to continental philosophy reading list (french post-structuralism, etc)
@arches
arches / cart.rb
Last active December 29, 2015 10:59
hash-backed shopping cart w session default
require 'active_support/hash_with_indifferent_access'
class Cart
include Enumerable
attr_writer :storage
def each(&blk)
deal_ids.each(&blk)
end

Hi.

I'd like tell you about a matter that is quite personal but will result in some changes in the way I present myself and interact with the commnunity.

I am transgender.

I have known that my body did not match my internal gender since I was a very small child, but I kept those feelings hidden and did my best to make my life work with the body I was born into. The result was chronic stress, physical and psychological pain, and a severe depression that culminated in an acute crisis in October of 2012. At that time I entered psychotherapy to explore my options.

I was diagnosed with Gender Identity Disorder, the treatment for which includes psychotherapy, hormonal treatments and potentially several surgeries. I have been working with my therapist and doctors, following the Standards of Care that set out treatment guidelines for my condition.

@avdi
avdi / gist:9038972
Created February 16, 2014 19:00
Get syntax highlighted source code for pasting into e.g. Google Docs on Linux
# You will need the pygments and xclip packages
# This example highlights some Bash source code
# '-O noclasses=true' tells pygments to embed colors inline in the source
# the '-t text/html' option tells xclip what "target" to specify for the selection
pygmentize -l bash -f html -O noclasses=true mysource.sh | xclip -selection clipboard -t text/html
@geeksam
geeksam / dsl-or-api-checklist.md
Last active June 12, 2017 20:46
The "Is It a DSL or an API?" Ten Question Checklist

[NOTE: The original version was posted in 2007 on an O'Reilly blog, but the page has been erroring out for months now. I'm copying it here because archive.org, while useful, can be slow. chromatic is a lovely person who (he thinks) probably has copyright to this piece.]


The "Is It a DSL or an API?" Ten Question Checklist

Saturday May 19, 2007 6:00AM
by chromatic in Opinion

@nateberkopec
nateberkopec / gist:11dbcf0ee7f2c08450ea
Last active March 24, 2023 21:59
RubySpec is dead, long live RubySpec!

Last night, Brian Shirai unilaterally "ended" the RubySpec project, a sub-project of Rubinius (the alternative Ruby implementation which Brian was paid to work on full-time from 2007 to 2013). The blog post describing his reasons for "ending" the project led to a big discussion on Hacker News.

When a single, competing Ruby implementation tells that you its test suite is the One True Way, you should be skeptical. Charles Nutter, Ruby core committer and JRuby head honcho, spent a lot of time last night on Twitter talking to people about what this decision means. He's probably too busy and certainly too nice of a guy to write about what is a political issue in the Ruby community, so I'm going to do it on behalf of all the new or intermediate Rubyists out there that are confused by Brian's decision and what it me

@derickfay
derickfay / fix_notes.applescript
Created April 16, 2015 16:55
Change Keynote Presenter Notes Font and Size for All Slides
tell application "Keynote"
tell document 1
set theSlides to slides
repeat with s in the slides
tell presenter notes of s
set font to "Helvetica"
set size to 24
end tell
end repeat
end tell