I hereby claim:
- I am stevenkaras on github.
- I am stevenkaras (https://keybase.io/stevenkaras) on keybase.
- I have a public key whose fingerprint is E751 0CE5 AFA6 EC89 3B84 74BE 65A0 9530 C7A4 9BD2
To claim this, I am signing this object:
# /usr/bin/env python | |
# The point of this exercise is to find a list of 5 words with 25 unique letters across them. | |
# As suggested by https://www.youtube.com/watch?v=_-AfhLQfb6w | |
# | |
# This problem is equivalent to searching for a disjoint set in the graph induced on shared letters between words. | |
# That problem is equivalent to searching for a clique in the inverse graph. | |
# The approach used here builds the graph as edges first between letters, then between words. | |
# Each step increases the cliques it found by 1 word. | |
# |
case "$SHELL" in | |
*fish) | |
[ -f "$HOME/.asdf/asdf.fish" ] && . "$HOME/.asdf/asdf.fish" | |
;; | |
*zsh) | |
[ -f "$HOME/.asdf/asdf.sh" ] && . "$HOME/.asdf/asdf.sh" | |
;; | |
*bash) | |
if [ "${BASH:-no}" != no ]; then | |
[ -f "$HOME/.asdf/asdf.sh" ] && . "$HOME/.asdf/asdf.sh" |
I hereby claim:
To claim this, I am signing this object:
# Detect all the palindromic sequences in a given string | |
# | |
# @return [<Range>] a list of all the palindromes in the given string | |
def all_palindromes(string) | |
preprocessed = "^#{string.chars.join("#")}$" | |
palindromes = [0] * preprocessed.length | |
center = 0 | |
right = 0 | |
for i in 1...preprocessed.length | |
mirror = center * 2 - i |
begin | |
require 'bundler/inline' | |
rescue LoadError => e | |
$stderr.puts 'Bundler version 1.10 or later is required. Please update your Bundler' | |
raise e | |
end | |
gemfile(true) do | |
source 'https://rubygems.org' | |
# Activate the gem you are reporting the issue against. |
#!/usr/bin/env bash | |
# This script runs services in the background, logs their output, and spins them down gently | |
# | |
# I use it in development, since I don't want to have databases and message brokers running | |
# all the time on my laptop. | |
# | |
# Reads a list of services either from ARGV or from a ".services" file | |
# Alternatively, can take a list of services (from either source) in label=command format |
# migrate.rb Migration/Copying/Merging Tool | |
# By Steven Karas | |
# MIT License | |
require 'csv' | |
require 'logger' | |
class Migration | |
def initialize(path, logger = Logger.new(nil)) | |
@path = path |
require 'resolv' | |
require 'net/smtp' | |
class EmailValidator | |
# Note that obsolete syntax support has been stripped | |
Pattern = %r{ | |
# From RFC 5322 s 3.2.1 | |
(?<quoted-pair> \\ [\x21-\x7e \t]){0} | |
# From RFC 5322 s 3.2.3 |
# Copyright Steven Karas 2013 - 2014 | |
# Licensed under MIT terms | |
# Represents a robots.txt file | |
class Robots | |
# Parse the given content as a robots.txt file | |
# | |
# @see http://www.robotstxt.org/ | |
def initialize(content) |
class URLHelpers::Env | |
include ActionController::UrlFor | |
include Sprockets::Rails::Helper | |
include Rails.application.routes.url_helpers | |
def self.config | |
Rails.application.config | |
end | |
def self.app |