Skip to content

Instantly share code, notes, and snippets.

View steveklabnik's full-sized avatar
🦀
Rustacean

Steve Klabnik steveklabnik

🦀
Rustacean
View GitHub Profile
/var/folders/pz/44gs4cwx62q14rqyb72nfx900000gn/T/ruby-build.20130226135311.29048 /opt/rubies
HTTP/1.0 200 OK
Content-Type: binary/octet-stream
Content-Length: 471759
Connection: keep-alive
x-amz-id-2: q1xtSQ9oFQJ52RR0qOxpRGE8FpSn2cJQGH3FtUQdqJxNGYBRYQPRz+hiyzK6oV9A
x-amz-request-id: DB36126021CACA90
Date: Wed, 12 Dec 2012 20:23:58 GMT
Last-Modified: Wed, 12 Dec 2012 18:53:11 GMT
ETag: "36c852831d02cf90508c29852361d01b"
RBC 1.8 lib/compiler/stages.rb
RBC 1.8 lib/melbourne.rb
RBC 1.8 lib/melbourne/processor.rb
GEN runtime/19/signature
RBC 1.9 kernel/bootstrap/basicobject.rb
rake aborted!
undefined method `name' for -2.0000000000407714:Float
/private/var/folders/pz/44gs4cwx62q14rqyb72nfx900000gn/T/ruby-build.20130226151619.30321/rubinius-2.0.0-dev/staging/lib/compiler/ast/definitions.rb:742:in `initialize'
/private/var/folders/pz/44gs4cwx62q14rqyb72nfx900000gn/T/ruby-build.20130226151619.30321/rubinius-2.0.0-dev/staging/lib/compiler/ast/definitions.rb:650:in `new'
/private/var/folders/pz/44gs4cwx62q14rqyb72nfx900000gn/T/ruby-build.20130226151619.30321/rubinius-2.0.0-dev/staging/lib/compiler/ast/definitions.rb:650:in `initialize'
@steveklabnik
steveklabnik / gist:5171193
Last active December 15, 2015 00:09
Resque roadmap
Rescue 1.x
----------
- Pretty good but has bugs
- used by a LOT of people. (30k)
- fixing issues that are open
- 1.23.x will be the end
- just bugfixes
Resque 2.0
@steveklabnik
steveklabnik / fetch_gists.rb
Last active December 15, 2015 15:29
Fetch Gists from the API
require 'net/http'
require 'json'
# a simple wrapper to do an HTTP GET
def fetch_uri(uri)
Net::HTTP.get_response(URI(uri))
end
# GETs the URI and returns a Ruby hash.
def fetch_json(uri)
<%= form_for(@project) do |f| %>
<% if @project.errors.any? %>
<div id="error_explanation">
<h2><%= pluralize(@project.errors.count, "error") %>
prohibited this project from being saved:</h2>
<ul>
<% @project.errors.full_messages.each do |msg| %>
<li><%= msg %></li>
<% end %>
Your points are good, but
> No amount of social justice can cure someone's schizophrenia.
I think one of the issues here is that mental illness carries so much stigma. It's hard to even get help at times due to this, and social change about the way we discuss and treat mental illness would be incredibly helpful.
I posted a link to a new startup here a few hours ago specifically designed to help people diagnosed with schizophrenia deal with their symptoms, and it got no upvotes. (for anyone interested, it's https://copingtutor.com/ Not mine, but a friend's)
We ourselves have a member of the community who's living with schizophrenia, and they're shadowbanned due to their illness. It's probably for the best, but it's a really shitty way of dealing with it.
@steveklabnik
steveklabnik / gist:5327393
Last active December 15, 2015 21:39
My brain is not threadsafe. Posted to the Ruby Parley mailing list.
If you care about writing threadsafe code, read this book:
http://www.amazon.com/Java-Concurrency-Practice-Brian-Goetz/dp/0321349601 it's
@tenderlove & @steveklabnik approved!
---------
A story.
I'm at a conference right now, listening to a talk and checking email. As I was
typing that sentence, the speaker pointed to some code on the screen, and I
rustc rust.rs
rust.rs:11:10: 11:24 error: the type of this value must be known in this context
rust.rs:11 chan.send(10);
^~~~~~~~~~~~~~
error: aborting due to previous error
make: *** [build] Error 101
@steveklabnik
steveklabnik / test.rb
Last active December 16, 2015 06:29
Test case for issue 1629
unless File.exists?('Gemfile')
File.write('Gemfile', <<-GEMFILE)
source 'https://rubygems.org'
gem 'rails', github: 'rails/rails'
gem 'sqlite3'
GEMFILE
system 'bundle'
end
@steveklabnik
steveklabnik / gist:5407181
Last active December 16, 2015 08:39
Why does this print something?
require 'minitest/autorun'
module Kernel
def sleep(n)
puts "calling sleep"
end
end
describe "stub" do
it "stubs stuff" do