Skip to content

Instantly share code, notes, and snippets.

@endolith
endolith / Has weird right-to-left characters.txt
Last active October 26, 2024 13:55
Unicode kaomoji smileys emoticons emoji
ּ_בּ
בּ_בּ
טּ_טּ
כּ‗כּ
לּ_לּ
מּ_מּ
סּ_סּ
תּ_תּ
٩(×̯×)۶
٩(̾●̮̮̃̾•̃̾)۶
@alexfish
alexfish / cloudmade tiles
Created April 5, 2011 19:15
returns cloudmade tiles in range
# Format:
# tiles = [
# zoom => [
# [ tx, ty, tz ],
# ],
# [
# [ tx, ty, tz ],
# ],
# zoom => [
# [ tx, ty, tz ],
@baldowl
baldowl / gallery.rb
Created April 13, 2011 09:19
Rough gallery plugin for Jekyll
@toamitkumar
toamitkumar / gist:952211
Created May 2, 2011 19:35
Inspect and test routes on console (Rails 3)
$ rails console
Loading development environment (Rails 3.0.6)
ruby-1.8.7-p334 :001 > r = Rails.application.routes
Gives you a handle of all the routes (config/routes.rb)
#Inspect a named route:
ruby-1.8.7-p334 :005 > r.recognize_path(app.destroy_user_session_path)
=> {:action=>"destroy", :controller=>"sessions"}
@mtunjic
mtunjic / to_haml.rb
Created June 21, 2011 10:55
Convert ERb views to Haml
class ToHaml
def initialize(path)
@path = path
end
def convert!
Dir["#{@path}/**/*.erb"].each do |file|
`html2haml -rx #{file} #{file.gsub(/\.erb$/, '.haml')}`
end
end
@huobazi
huobazi / install_ruby.sh
Created August 10, 2011 03:02 — forked from gyulalaszlo/install_rails_stack.sh
Debian Squeeze i686 from blank install to RVM + Ruby 1.9.2 + MongoDB 1.8.2 + NGINX + Passenger
cd $HOME
mkdir binaries
cd binaries/
echo "Installing dev toolchain"
sudo apt-get install curl git bzip2 gcc make build-essential libcurl4-openssl-dev libssl-dev zlib1g-dev
echo "Getting Mongo..."
@ntlk
ntlk / html5.haml
Created September 26, 2011 20:53 — forked from fnhipster/html5.haml
HTML5 HAML Template
!!! 5
%html{ :lang => "en"}
%head
%title= "Your Website"
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
%meta{ :content => "", :name => "description" }
%meta{ :content => "", :name => "author" }
%meta{ :content => "3 days", :name => "revisit-after" }
%link{ :href => "http://creativecommons.org/licenses/by/3.0/", :rel => "license", :title => "Creative Commons Attribution 3.0 Unported License" }
%link{ :href => "/feed", :rel => "alternate", :title => "Atom", :type => "application/atom+xml" }
@simme
simme / Install_tmux
Created October 19, 2011 07:55
Install and configure tmux on Mac OS X
# First install tmux
brew install tmux
# For mouse support (for switching panes and windows)
# Only needed if you are using Terminal.app (iTerm has mouse support)
Install http://www.culater.net/software/SIMBL/SIMBL.php
Then install https://bitheap.org/mouseterm/
# More on mouse support http://floriancrouzat.net/2010/07/run-tmux-with-mouse-support-in-mac-os-x-terminal-app/
@edouard
edouard / dominant_colors.rb
Created February 10, 2012 08:53
A ruby script to get the most dominant colours in an image (uses ImageMagick)
require 'RMagick'
TOP_N = 10 # Number of swatches
# Create a 1-row image that has a column for every color in the quantized
# image. The columns are sorted decreasing frequency of appearance in the
# quantized image.
def sort_by_decreasing_frequency(img)
hist = img.color_histogram
# sort by decreasing frequency
@jdevalk
jdevalk / gist:1918689
Created February 26, 2012 19:58
Turn a spiderable list of links into a dropdown + a go button with jQuery
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
<script type="text/javascript">
// Inspiration partly from: http://stackoverflow.com/questions/1897129
jQuery(document).ready(function($) {
$('ul.dropdown').each(function(){
var list = $(this);
var select = $(document.createElement('select'))
.attr('id',$(this).attr('id'))