Skip to content

Instantly share code, notes, and snippets.

View johana-star's full-sized avatar
🕶️

Johana Star johana-star

🕶️
View GitHub Profile

Fixed: I mispelt initialize.

I've created 'dude', a gem which overrides exceptions to make them more Lebowski-y.

The code is on github and the gem is on rubygems. The relevant code is in dude.rb, which reads as follows:

class Exception
  def intialize(message)
 @message = message
@johana-star
johana-star / gist:5062975
Last active December 14, 2015 09:09 — forked from southpolesteve/gist:5060497
I tried to simplify this, but man, I don't know if I can crush down these conditionals and enumerables.
namespace :cleaner do
task :find do
models = Dir.glob("app/models/**/*")
methods = %w[]
models.each do |model|
if File.file?(model)
File.open(model).lines.each do |line|
if method = method_name? line
@johana-star
johana-star / gist:5010358
Created February 22, 2013 02:48
Extended tweet responding to @nthmost
@nthmost @mcmoots There's no winning with some people, and this stuff is complex.
I recently read bell hooks' [Understanding Patriarchy](http://imaginenoborders.org/pdf/zines/UnderstandingPatriarchy.pdf) in which she deftly explains what patriarchy is and how it hurts women and men. I don't think the anti-misandrists really grok the whole (patri|kyri)archy thing, they just feel a sense of powerlessness which they attribute to a loss of privilege because straw feminists took it away.
bell hooks definition of patriarchy is: "a political-social system that insists that males are inherently dominating, superior to everything and everyone deemed weak, especially females, and endowed with the right to dominate and rule over the weak and to maintain that dominance through various forms of psychological terrorism and violence." Kyriarchy, as I understand it, is pretty much this same system of social conditioning and control, with the lens of multiple axes of control and submission–so instead of just having gender a
@johana-star
johana-star / my_names.txt
Last active December 10, 2015 21:48
A biographical sketch of the names I have used legally.
When I was born, my parents named me B_____ Daniel Strand.* I went by this name in childhood,
as a teenager, and as a young adult. While I was in college, I began using Livejournal, and used
strand as my handle there. I also preferred that people call me Strand then, but told people that
they could refer to me by my last name or my former first name at the time.
A few years after I graduated college, after working several jobs where colleagues and
coworkers called me Strand, I had my name legally changed to B Strand. I realized almost
immediately afterwards that I would have mad my life easier had I adopted the name Be Strand,
as many computer systems do not accept B as a first name. (I was unable to use Priceline at one
time, though they have since fixed this bug.)
Feature: Providing passwords at the command line
As a person I need to generate memorable passwords at the command line
In order to have unique passwords anywhere I use them.
Scenario: Simple password
Given the user calls 'dynamo'
Then the program returns a simple passphrase
Scenario: Complex password
Given the user calls 'dynamo --complex'
@johana-star
johana-star / Preferences.sublime-settings.json
Last active October 13, 2015 15:57
My sublime settings
{
"bold_folder_labels": true,
"caret_style": "phase",
"color_scheme": "Packages/Color Scheme - Default/Solarized (Light).tmTheme",
"draw_minimap_border": true,
"fade_fold_buttons": false,
"font_face": "Courier Prime",
"font_size": 26.0,
"highlight_modified_tabs": true,
"highlight_line": true,
@johana-star
johana-star / example.rb
Created December 5, 2012 20:06
A gist demoing four valid ways to write do…while functionality in Ruby
# Which is the most stylistically correct way to emulate a do…while in Ruby?
# option one
begin
mark = gets.chomp
end unless mark == "A2" # loops again when the mark is A2.
# option two
loop do
mark = gets.chomp
@johana-star
johana-star / console.rb
Created November 10, 2012 17:52
Having a little trouble testing methods in RSpec
class Console
def self.load_dictionary(dictionary = "#{File.dirname(__FILE__)}/english.dict")
word_list = []
File.open(dictionary) do |file|
file.each{ |line| word_list << line.strip.downcase }
end
word_list.uniq!
@johana-star
johana-star / generate_password.rb
Created August 5, 2012 18:55
A simple password generator
words, password = [], ''
min_word_length, max_word_length, words_in_password = 4, 8, 4 + rand(2)
File.open("/usr/share/dict/words") do |file|
file.each do |line|
if line.length <= max_word_length and line.length >= min_word_length
words << line.strip.downcase
end
end
end
@johana-star
johana-star / tomato.rb
Last active October 5, 2015 08:08 — forked from mathias/tomato.rb
SassyTomato Timer (for pomodoros)
Shoes.app :height => 215, :width => 215, :title => "SassyTomato" do
background pink
@time_to_start = Time.new
@stopped = true
def timer_button(args)
button args[:name] do
@time_to_stop = Time.now + args[:minutes] * 60 + 0.05
run