Idea.find_each do |idea|
idea.picture.recreate_versions!(:thumb)
end
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for f in *.jpg; do | |
convert ./"$f" -gravity center -resize 1137 -extent 1137x640 -blur 0x4 ./finalcat/"new-$f" | |
convert ./finalcat/"new-$f" -page +248 ./"$f" -flatten ./finalcat/"new-$f" | |
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Downloading https://github.com/wayneeseguin/rvm/archive/1.26.9.tar.gz | |
curl: (23) Failed writing body (0 != 861) | |
Could not download 'https://github.com/wayneeseguin/rvm/archive/1.26.9.tar.gz'. | |
curl returned status '23'. | |
Downloading https://bitbucket.org/mpapis/rvm/get/1.26.9.tar.gz | |
curl: (23) Failed writing body (0 != 15973) | |
Could not download 'https://bitbucket.org/mpapis/rvm/get/1.26.9.tar.gz'. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# app/models/ability.rb | |
module Ability | |
class << self | |
def ability_for user, options = {} | |
abilities = AnonymousAbility.new | |
return abilities unless user | |
abilities.merge MemberAbility.new user, options |
require 'benchmark/ips'
class Array
def to_proc
->(h) { length == 1 ? h[first] : h.values_at(*self) }
end
end
LANGUAGE_AND_AGE = [
Ideas are cheap. Make a prototype, sketch a CLI session, draw a wireframe. Discuss around concrete examples, not hand-waving abstractions. Don't say you did something, provide a URL that proves it.
Nothing is real until it's being used by a real user. This doesn't mean you make a prototype in the morning and blog about it in the evening. It means you find one person you believe your product will help and try to get them to use it.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
module Forwardable | |
FORWARDABLE_VERSION = "1.1.0" | |
FILE_REGEXP = %r"#{Regexp.quote(__FILE__)}" | |
@debug = nil | |
class << self | |
attr_accessor :debug | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Levenshtein Distance | |
# implementation given at http://en.wikipedia.org/wiki/Levenshtein_distance | |
# This file is in the public domain. | |
require 'matrix' | |
def levenshtein_distance str1, str2 | |
str1_len = str1.size | |
str2_len = str2.size | |
width = str1_len + 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
500 Internal Server Error | |
Sorry, something went wrong. | |
A team of highly trained monkeys has been dispatched to deal with this situation. | |
If you see them, show them this information: | |
AB38WEP4JRdI_m4SFO2vFKPSuj3aFEwG3uopBpGPl8m2FrTp4DpsVRa2fT7s | |
4sgBLq8tCq0RY29fbUrN8dYjRC_A1yq8XyAk0xF8CWGf9IJsB0UuitmDmnyh | |
YB0lj3lHaPgfSmFz5BNbtjltGRjHwgexw0WvuKq-rvx0lJtt4PsbH6ZGzywG |