View gem_spec_rake_task.rb
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
namespace :gem | |
task :spec => :version do | |
file = File.new(__DIR__ + "fold.gemspec", 'w+') | |
spec = %{ | |
Gem::Specification.new do |s| | |
s.name = "fold" | |
s.version = "#{@version}" | |
s.platform = Gem::Platform::RUBY | |
s.has_rdoc = false | |
s.summary = "Toolkit for creating whitespace active mini-languages. Inspired by Haml. Feature light." |
View gist:3128
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
form.ajaxForm().ajaxSubmit({ | |
// target: "#divToUpdate", | |
url: that._options.uploadUrl, | |
// dataType: "json", | |
method: "POST", | |
iframe: true, | |
success: function(response) { | |
that.insertImage(response, | |
form.find(that._options.titleSelector).val(), | |
form.find(that._options.altSelector).val()); |
View gist:3223
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
$.password | |
:blur | |
if @value === "" | |
.hide() | |
var faux = $this.prev() | |
faux.show().val(faux.attr('default_value')) | |
.blur() | |
$.faux-password |
View example
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
Strangly, this breaks with Mongrel when uploading a matching "*.mp3" (possibly others) |
View gist:3363
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
$.password | |
:blur | |
if @value === "" | |
.hide() | |
// Eventually, indenting beneath something will set it as the context | |
.prev() | |
.show().val(@default_value) | |
.blur() | |
View .irbrc
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
require 'rubygems' | |
require 'pathname' | |
__DIR__ = Pathname.new(__FILE__).dirname.expand_path | |
eval (__DIR__+".irbrc").read if (__DIR__+".irbrc").exist? |
View fall_through.rb
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 Johnson | |
module Nodes | |
attr_accessor :value | |
class FallThrough < Node | |
def initialize(_row, _column, value) | |
@value = value | |
end | |
end | |
end | |
View fun.haml
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
/No, now I <3 Ruby | |
!!! | |
%html | |
%head | |
%link{:rel => :stylesheet, :type => "text/css", :href => "#{params[:name]}.css"} | |
%body | |
=yield |
View gist:5954
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
/I would not have done this with HTML | |
/hooray, haml enables awesome protoyping! | |
.compositions | |
%ul | |
%li | |
Resources | |
%ol | |
%li | |
.resources | |
%ol |
View blah.html.haml
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
%p Hello new user! | |
- 10.times do |n| | |
- unless n.odd? | |
== Why it's the number #{n} |
OlderNewer