Skip to content

Instantly share code, notes, and snippets.

View ayumi's full-sized avatar
🍅
ᕕ( ᐛ )ᕗ

ayumi  yu ayumi

🍅
ᕕ( ᐛ )ᕗ
View GitHub Profile
@mperham
mperham / after.rb
Created July 4, 2012 19:30
Thread-friendly shared connection
class ActiveRecord::Base
mattr_accessor :shared_connection
@@shared_connection = nil
def self.connection
@@shared_connection || ConnectionPool::Wrapper.new(:size => 1) { retrieve_connection }
end
end
ActiveRecord::Base.shared_connection = ActiveRecord::Base.connection
@ayumi
ayumi / kawaii_phrase.rb
Created April 5, 2012 03:29
Random positive 3-word phrase generator (e.g. "Enjoyable Green Turtle")
module KawaiiPhrase
# Makes awesome random phrases such as "Enjoyable Green Turtle"
ADJ_1 = [
'epic',
'tasty',
'shiny',
'mega',
'ultra',
'hyper',
@davidcornu
davidcornu / SoundParser.rb
Created August 25, 2011 17:23
Convert MP3 Files to Waveform Images in Ruby
# --------------------------------------------------------------------
# Create SoundCloud-style waveforms from mp3 files
# Author: David Cornu
# Credit for the idea goes to http://cl.ly/292t2B09022I3S3X3N2O
#
# Requirements:
# mpg123 - [ % brew install mpg123 ]
# imagemagick - [ % brew install imagemagick ]
# rmagick - [ % brew install rmagick ]
#
@endolith
endolith / Has weird right-to-left characters.txt
Last active March 5, 2025 17:59
Unicode kaomoji smileys emoticons emoji
ּ_בּ
בּ_בּ
טּ_טּ
כּ‗כּ
לּ_לּ
מּ_מּ
סּ_סּ
תּ_תּ
٩(×̯×)۶
٩(̾●̮̮̃̾•̃̾)۶