Skip to content

Instantly share code, notes, and snippets.

View steveklabnik's full-sized avatar
🦀
Rustacean

Steve Klabnik steveklabnik

🦀
Rustacean
View GitHub Profile
// paste in your console
speechSynthesis.onvoiceschanged = function() {
var msg = new SpeechSynthesisUtterance();
msg.voice = this.getVoices().filter(v => v.name == 'Cellos')[0];
msg.text = Object.keys(window).join(' ');
this.speak(msg);
};
@edunham
edunham / ferris.cow
Last active October 29, 2015 20:40
##
## Ferris
##
$the_cow = <<EOC;
$thoughts _ /\\ _
$thoughts _ | \\ / \\ / | _
$thoughts | `\\ | \\/ \\/ |_/` |
$thoughts _____| |______
$thoughts | /
_____| /______ /|
@wilkie
wilkie / diversity_links.md
Last active June 15, 2021 16:49
Some links devoted to diversity discussion.
@burtlo
burtlo / rails_features.md
Created February 17, 2013 06:39
Some common errors after finishing the Jumpstart Lab Blogger tutorial a number of times.

Rake Routes

Problem

Running rake routes with a new rails application displays no information.

Solution

@ono
ono / travis-pro.markdown
Created November 1, 2012 14:38
Travis CI pro beta note

1st November, 2012

Summary

Luckily we have got a beta access to Travis CI pro which allows you to build your private repos on github. I did some research for my work and we have decided to replace our Jenkins to Travis CI pro. I leave some notes here.

Background

We have bunch of private repositories, mainly Ruby (rails and gems), on github that we want to continuously test. We currently maintain two CI servers: Buildbot for legacy project and Jenkins for recent projects. On this research, I simply ignored the legacy one and evaluated Travis CI pro as an alternative for Jenkins.

@jamiehodge
jamiehodge / index.slim
Created April 12, 2012 20:51
HTML5-based collection media type
ul
- for keyword in keywords
li
a rel='item' href=url("/#{keyword.id}", false) = keyword.name
nav
ul
- if keywords.next_page
li
a rel='next' href=url("/?page=#{keywords.next_page}", false) Next Page
@seancribbs
seancribbs / Gemfile
Created March 14, 2012 20:25
Static/file resources in Webmachine
source :rubygems
gem 'webmachine'
gem 'rack'
@josevalim
josevalim / lint_test.rb
Created February 7, 2012 21:16
Custom AMo model for forms
class LintTest < ActiveSupport::TestCase
include ActiveModel::Lint::Tests
class Model
# model.to_model
include ActiveModel::Conversion
# Implements Model.model_name
extend ActiveModel::Naming
@mnutt
mnutt / Instrument Anything in Rails 3.md
Created September 6, 2010 06:50
How to use Rails 3.0's new notification system to inject custom log events

Instrument Anything in Rails 3

With Rails 3.0 released a few weeks ago I've migrated a few apps and I'm constantly finding useful new improvements. One such improvement is the ability to log anything in the same way that Rails internally logs ActiveRecord and ActionView. By default Rails 3 logs look slightly spiffier than those produced by Rails 2.3: (notice the second line has been cleaned up)

Started GET "/" for 127.0.0.1 at Mon Sep 06 01:07:11 -0400 2010
  Processing by HomeController#index as HTML
  User Load (0.2ms)  SELECT `users`.* FROM `users` WHERE (`users`.`id` = 3) LIMIT 1
  CACHE (0.0ms)  SELECT `users`.* FROM `users` WHERE (`users`.`id` = 3) LIMIT 1

Rendered layouts/_nav.html.erb (363.4ms)

@rtomayko
rtomayko / Tests Is Wrong
Created January 28, 2009 20:50
Why "require 'rubygems'" In Your Library/App/Tests Is Wrong
In response to all the responses to:
http://twitter.com/rtomayko/status/1155906157
You should never do this in a source file included with your library,
app, or tests:
require 'rubygems'
The system I use to manage my $LOAD_PATH is not your library/app/tests