I just ran over a nice code-snippet online-database: 'Programming is
Hard' at http://programmingishard.com/
So let's spread our best Ruby-Code to help the others out there to
improve their code.
I just ran over a nice code-snippet online-database: 'Programming is
Hard' at http://programmingishard.com/
So let's spread our best Ruby-Code to help the others out there to
improve their code.
"naPOLeon" <naPOLeon.Polzer@gmx.de> writes:
I just ran over a nice code-snippet online-database: 'Programming is
Hard' at http://programmingishard.com/So let's spread our best Ruby-Code to help the others out there to
improve their code.
This is the third kind of snippet site I see today---they all look the
same. Wouldn't it be more effective to unify them?
--
Christian Neukirchen <chneukirchen@gmail.com> http://chneukirchen.org
I have snippets on my wiki, but programmingishard.com is much cooler.
In fact it's very cool, and I say COOL WINS! I'm going to put all my
snippets there!
L
On 8/2/06, naPOLeon <naPOLeon.Polzer@gmx.de> wrote:
I just ran over a nice code-snippet online-database: 'Programming is
Hard' at http://programmingishard.com/So let's spread our best Ruby-Code to help the others out there to
improve their code.
Christian Neukirchen wrote:
This is the third kind of snippet site I see today---they all look the
same. Wouldn't it be more effective to unify them?
Hmpf ... I spend whole *days* writing code snippets and never get a chance to assemble and refactor them into real software :).
ActiveState does this for a number of languages:
The keys to making this work really well, I would think, would be:
1. Keep the snippets categorized for easy browsing.
2. Provide a means for users to comment on the snippets (since they
may want to provide corrections or alternatives).
3. Explicitly specify the terms by which all the snippets will be made
available (public domain might make the most sense here).
4. Provide a link to download all snippets in a tar.gz file. (Oooh --
maybe even including the user comments as separate text files... [muah
ha ha ha!])
Might make a great but simple RoR project for some scrappy Rubyist pup!
---John
On 8/2/06, Christian Neukirchen <chneukirchen@gmail.com> wrote:
"naPOLeon" <naPOLeon.Polzer@gmx.de> writes:
> I just ran over a nice code-snippet online-database: 'Programming is
> Hard' at http://programmingishard.com/
>
> So let's spread our best Ruby-Code to help the others out there to
> improve their code.This is the third kind of snippet site I see today---they all look the
same. Wouldn't it be more effective to unify them?
The increasing amount of snippet sites is pretty annoying. There is
now programmingishard, the big bold site, and the rails tips site from
techno weenie, and a couple others I'm sure I'm missing.
I also find that all of these sites lack any sort of good search. How
can I easily find all snippets matching "ruby" and "metaprogramming"
at the big bold site? How about everything "rails" and "activerecord"
but not "rhtml" or "view"? Just having a bulk listing of the 500 ruby
snippets or whatever is not very helpful...
- Rob
On 8/2/06, Christian Neukirchen <chneukirchen@gmail.com> wrote:
"naPOLeon" <naPOLeon.Polzer@gmx.de> writes:
> I just ran over a nice code-snippet online-database: 'Programming is
> Hard' at http://programmingishard.com/
>
> So let's spread our best Ruby-Code to help the others out there to
> improve their code.This is the third kind of snippet site I see today---they all look the
same. Wouldn't it be more effective to unify them?--
Christian Neukirchen <chneukirchen@gmail.com> http://chneukirchen.org
--
Yes, but that means those people would need to become unified, but I
somehow think that, at the genesis of these competing sites, they've
become, themselves, competitors, and possibly unable to unify in that
regard.
So, you are faced with an awkward decision: use none or make your own
that will become the defacto.
Hmmm, and neither of those really work, do they? (Despite your clout.)
But, you're right, I'd like them to be unified as well.
M.T.
I'd add 5. dont be textsnippets.com - has anyone noticed that it looks just
like programmingishard.com, only with a worse design because of the google
ads? ![]()
One thing I'd like to see is a "snippet a day" or "tip a day" site to help
with my morning procrastination ritual.
On Thursday 03 August 2006 20:15, John Gabriele wrote:
On 8/2/06, Christian Neukirchen <chneukirchen@gmail.com> wrote:
> "naPOLeon" <naPOLeon.Polzer@gmx.de> writes:
> > I just ran over a nice code-snippet online-database: 'Programming is
> > Hard' at http://programmingishard.com/
> >
> > So let's spread our best Ruby-Code to help the others out there to
> > improve their code.
>
> This is the third kind of snippet site I see today---they all look the
> same. Wouldn't it be more effective to unify them?ActiveState does this for a number of languages:
ActiveState Community - Boosting coder and team productivity with ready-to-use open source languages and tools.The keys to making this work really well, I would think, would be:
1. Keep the snippets categorized for easy browsing.
2. Provide a means for users to comment on the snippets (since they
may want to provide corrections or alternatives).3. Explicitly specify the terms by which all the snippets will be made
available (public domain might make the most sense here).4. Provide a link to download all snippets in a tar.gz file. (Oooh --
maybe even including the user comments as separate text files... [muah
ha ha ha!])Might make a great but simple RoR project for some scrappy Rubyist pup!
---John
John Gabriele wrote:
ActiveState does this for a number of languages:
ActiveState Community - Boosting coder and team productivity with ready-to-use open source languages and tools.The keys to making this work really well, I would think, would be:
1. Keep the snippets categorized for easy browsing.
That right there is the really hard part! Everything
after that is a piece of cake.
The problem is compounded by the fact that a good
snippet library nests. One snippet will show basic
file reading, another will show a regular expression
pattern, and a third will integrate both of them into
a snippet that does some useful task.
Then there is the synonym issue. Snippets are a great
way to answer the "how do I do that?" question, and
a snippet library is easily searched when you know the
keywords you're looking for.
But when you don't know the keywords in advance, the
library needs a synonym generation mechanism (so they
get included in snippet comments) or a translation
mechanism, so people coming from different languages
will find the different ways Ruby uses to carry out
familiar tasks.
It's one /terrific/ AI project. I would think that a
paper on "how to do it right" would make a great thesis.
long ago i suggested the subject line [SNIPPET] for postings to comp.lang.ruby
- google already indexes it - it would at least be a single unified space.
-a
On Thu, 3 Aug 2006, Matt Todd wrote:
Yes, but that means those people would need to become unified, but I
somehow think that, at the genesis of these competing sites, they've
become, themselves, competitors, and possibly unable to unify in that
regard.So, you are faced with an awkward decision: use none or make your own
that will become the defacto.Hmmm, and neither of those really work, do they? (Despite your clout.)
But, you're right, I'd like them to be unified as well.
M.T.
--
we can never obtain peace in the outer world until we make peace with
ourselves.
- h.h. the 14th dali lama
Or, kludge up something that uses those other sites as backends, so
you can search all the clip sites from a single interface.
This is the Ruby list after all, right?
;D
On 8/3/06, Matt Todd <chiology@gmail.com> wrote:
So, you are faced with an awkward decision: use none or make your own
that will become the defacto.
--
Daniel Baird
http://tiddlyspot.com (free, effortless TiddlyWiki hosting)
http://danielbaird.com (TiddlyW;nks! :: Whiteboard Koala :: Blog ::
Things That Suck)
Actually the bigbold snippets site was written by Peter Cooper is an open source rails app. Both textsnippets and programmingishard both are using the same open code from bigbold.
-Ezra
Daniel Higginbotham wrote:
One thing I'd like to see is a "snippet a day" or "tip a day" site to help with my morning procrastination ritual.
LOL. THAT would be a great way to get a painless education.
A mashup of snippets. Makes me drool in fright! 
Yes, but that means those people would need to become unified, but I
somehow think that, at the genesis of these competing sites, they've
become, themselves, competitors, and possibly unable to unify in that
regard.So, you are faced with an awkward decision: use none or make your own
that will become the defacto.Hmmm, and neither of those really work, do they? (Despite your clout.)
But, you're right, I'd like them to be unified as well.
M.T.
long ago i suggested the subject line [SNIPPET] for postings to comp.lang.ruby
- google already indexes it - it would at least be a single unified space.-a
This is an idea I like. So in honor of the fact that I stole the format for this script from you ara, I'd like to present my favorite little script / snippet, rbmlexample:
Usage: ruby rblmlexample.rb <somefile.rb> [ arguments for somefile.rb ]
It copies the results of running somefile.rb and also somefile.rb to the clipboard on Mac OS X (In ara's style of cat blah.rb ruby blah.rb), where you can then paste it into a ruby talk email.
It's dependent on pbcopy, but I imagine a little search and replace could adapt it for xclip. In retrospect this is probably a bit too long to be a snippet. Ah well.
% cat rbmlexample.rb
#!/usr/bin/env ruby
$VERBOSE = true
begin
file_name = ARGV.shift or raise 'You need to supply a file name'
IO.popen('pbcopy', 'r+') do |clipboard|
clipboard.puts "% cat #{file_name}"
file_src = nil
File.open(file_name) do |source_code|
file_src = source_code.read
end
clipboard.puts file_src
clipboard.puts ''
ruby_res = nil
IO.popen('ruby 2>&1', 'r+') do |ruby|
ruby.puts 'STDOUT.sync = true'
ruby.puts %Q{
begin
old_verbose = $VERBOSE
$VERBOSE = nil
ARGV = #{ARGV.inspect}
ensure
$VERBOSE = old_verbose
end
}
ruby.puts file_src
ruby.close_write
ruby_res = ruby.read
end
clipboard.puts "% ruby #{file_name}"
clipboard.puts ruby_res
end
rescue => ex
STDERR.puts "#{File.basename($0)}: error: #{ex.message}"
end
On Aug 3, 2006, at 12:01 AM, ara.t.howard@noaa.gov wrote:
On Thu, 3 Aug 2006, Matt Todd wrote:
--
we can never obtain peace in the outer world until we make peace with
ourselves.
- h.h. the 14th dali lama
Terrific suggestion!
ara.t.howard@noaa.gov wrote:
On Thu, 3 Aug 2006, Matt Todd wrote:
long ago i suggested the subject line [SNIPPET] for postings to comp.lang.ruby
- google already indexes it - it would at least be a single unified space.
Absolutely . . . as long as the snippets came with concise, but
thorough, explanations.
On Sun, Aug 13, 2006 at 12:16:29PM +0900, Eric Armstrong wrote:
Daniel Higginbotham wrote:
>
>One thing I'd like to see is a "snippet a day" or "tip a day" site to help
>with my morning procrastination ritual.
>
LOL. THAT would be a great way to get a painless education.
--
CCD CopyWrite Chad Perrin [ http://ccd.apotheon.org ]
"The first rule of magic is simple. Don't waste your time waving your
hands and hopping when a rock or a club will do." - McCloctnick the Lucid
But I have the courage to omit the smiley ![]()
Robert
On 8/3/06, Matt Todd <chiology@gmail.com> wrote:
A mashup of snippets. Makes me drool in fright!
Strange I had exactly the same feeling, but lacked the courage to say so.
--
Deux choses sont infinies : l'univers et la bêtise humaine ; en ce qui
concerne l'univers, je n'en ai pas acquis la certitude absolue.
- Albert Einstein
> Daniel Higginbotham wrote:
> >One thing I'd like to see is a "snippet a day" or "tip a day" site to help
> >with my morning procrastination ritual.
same, here.. for certain definitions of the word "help" ![]()
On 8/13/06, Chad Perrin <perrin@apotheon.com> wrote:
Absolutely . . . as long as the snippets came with concise, but
thorough, explanations.
Yes yes! That's the thing that turns a "curious looking" snippet into
a "teaching something" snippet.
;Daniel
--
Daniel Baird
http://tiddlyspot.com (free, effortless TiddlyWiki hosting)
http://danielbaird.com (TiddlyW;nks! :: Whiteboard Koala :: Blog ::
Things That Suck)
I could, perhaps, contribute a mailing list and editing if I can get
others to contribute snippets and explanations.
On Sun, Aug 13, 2006 at 09:20:44PM +0900, Daniel Baird wrote:
>> Daniel Higginbotham wrote:
>> >One thing I'd like to see is a "snippet a day" or "tip a day" site to
>help
>> >with my morning procrastination ritual.same, here.. for certain definitions of the word "help"
On 8/13/06, Chad Perrin <perrin@apotheon.com> wrote:
>Absolutely . . . as long as the snippets came with concise, but
>thorough, explanations.Yes yes! That's the thing that turns a "curious looking" snippet into
a "teaching something" snippet.
--
CCD CopyWrite Chad Perrin [ http://ccd.apotheon.org ]
This sig for rent: a Signify v1.14 production from http://www.debian.org/