Skip to content

Instantly share code, notes, and snippets.

@pachacamac
pachacamac / ruby_nuggets.rb
Created October 21, 2012 19:36
Some very nice tricks and helpful magic in Ruby
# $ grep '^###' ruby_nuggets.rb
# if you just want all headlines
### multiple heredoc goodness
head,body = <<END_HEAD,<<END_BODY
this is the head
yea still head
END_HEAD
and now some body
it is #{Time.now} now
@brentd
brentd / parallel_asset_compiler.rb
Created July 31, 2012 23:11
Parallelize assets:precompile
require 'parallel' # gem install parallel (https://github.com/grosser/parallel)
# Monkey patch to Sprockets::StaticCompiler, a class provided by actionpack
# that's used by the assets:precompile task. This patch uses the Parallel gem
# to parallelize asset compilation in the simplest way possible.
#
# Parallel wraps Process.fork to handle things like inter-process communication
# via pipes and determining the maximum number of processes to run based on
# your system's total logical processors. So far only tested on MRI 1.9.3 on OS X.
module Sprockets
@endolith
endolith / Has weird right-to-left characters.txt
Last active April 30, 2024 12:48
Unicode kaomoji smileys emoticons emoji
ּ_בּ
בּ_בּ
טּ_טּ
כּ‗כּ
לּ_לּ
מּ_מּ
סּ_סּ
תּ_תּ
٩(×̯×)۶
٩(̾●̮̮̃̾•̃̾)۶