34 chars:
<v"g()('al')"
,<v!-"'"_
,,_>"o",^@
All of the examples print correctly: g('al')
-> gal
, g()()()('al')
-> goooal
etc.
34 chars:
<v"g()('al')"
,<v!-"'"_
,,_>"o",^@
All of the examples print correctly: g('al')
-> gal
, g()()()('al')
-> goooal
etc.
61 chars:
$><<('%f'%gets).gsub(/\d(?=\d{3}+\.)/,'\&,').sub(/\.?0+$/,'')
Handles floats, integers, signed numbers and strings. Also strips trailing zeros and avoids scientific notation.
33 chars for ruby 1.9+:
p [*?A..?Z]-gets.upcase.chars==[]
34 chars another way:
p (?a..?z).grep(/[^#{gets}]/i)==[]
<style> | |
.highlight table td { | |
padding: 5px; | |
} | |
.highlight table pre { | |
margin: 0; | |
} | |
</style> | |
<div class="highlight"><table style="border-spacing: 0"><tbody><tr><td class="gutter gl" style="text-align: right"><pre class="lineno">1 |
class Middleman::Extensions::DirManager < Middleman::Extension | |
register :dir_manager | |
option :dirs, {source: 'pages', destination: '', add: [], remove: ['', 'pages']} | |
def manipulate_resource_list resources | |
[options.dirs].flatten.each do |opts| | |
# Remove pages if specified | |
opts[:remove].each do |dir| | |
resources.reject! do |page| | |
Dir.glob(normalise(dir) + '/*', File::FNM_DOTMATCH).include? page.source_file |