You are here: Blogsphere Longtail

Rails BlogSphere

BlogSphere

Keep up to date with your favourite Rails bloggers in context.

Read more about how it works


In_the_office_profile Watwet from Apie [12/01/2010 23:48]

by Waheed Barghouthi | over 2 years ago | Read more

In two of the species studied by Rosenblum and her team, the fence lizard and the whiptail lizard, the researc... http://watwet.com/u/c38965

Karl How do I learn programming to create web-based applications? | Ask MetaFilter

by Rick Bradley | over 2 years ago | Read more

How do I learn programming to create web-based applications? | Ask MetaFilter:

everyone says to use Python or PHP (posted by cardioid)

The Diminishing Returns of Long Hours

by Steve Madsen | over 2 years ago | Read more

A lesson I learned during my years in university and had to re-learn once or twice while working in Silicon Valley is that working long hours is beneficial, but only for a very short period of time. One or two 60 hour weeks is enough, as is even a single all-nighter. When you’re sleep deprived, [...]

Karl PHP Must Die

by Rick Bradley | over 2 years ago | Read more

PHP Must Die:

(posted by donaldball)

malloc Debugging

by Steve Madsen | over 2 years ago | Read more

Bill Bumgarner posted a nice tutorial on using malloc to debug memory misuse in Cocoa. I’ve run across these before when reading the malloc(1) man page, but it’s nice to have a tutorial that shows how to use them in practice.

Karl Somali Pirates Not All Bad | The Awl

by Rick Bradley | over 2 years ago | Read more

Somali Pirates Not All Bad | The Awl:

(posted by arafatm)

Karl I Have No Talent // RailsTips by John Nunemaker

by Rick Bradley | over 2 years ago | Read more

I Have No Talent // RailsTips by John Nunemaker:

(posted by cardioid)

Surf_s_up Untitled

by Brian Del Vecchio | over 2 years ago | Read more

Brian Del Vecchio
Untitled

My120_135 RE: help! не получается пушить репо на Gitorius

by Ruslan Voloshin | over 2 years ago | Read more

попробуй так
ssh zhoran@gitorious.org
а когда запросит пароль, введи 20100112
хотя.. стоп, у тебя патти.. мммм. там по моему логин zhorah и хост gitorious.org указываются перед входом.. при входе в консоли просто пароль вводится..

мне этот хост не даёт войти.. ругается что я - это не ты..))
vitaly@vitaly-laptop:~$ ssh zhoran@gitorious.org
The authenticity of host 'gitorious.org (87.238.52.168)' can't be established.
RSA key fingerprint is 7e:af:8d:ec:f0:39:5e:ba:52:16:ce:19:fa:d4:b8:7d.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added 'gitorious.org,87.238.52.168' (RSA) to the list of known hosts.
Permission denied (publickey).
vitaly@vitaly-laptop:~$

Karl VH1 Reality Show Bus Crashes In California Causing Major Slut Spill | The Onion - America's Finest News Source

by Rick Bradley | over 2 years ago | Read more

VH1 Reality Show Bus Crashes In California Causing Major Slut Spill | The Onion - America's Finest News Source:

use headphones at work, but the onion’s still got it (posted by brandonvalentine)

Jerry135x135 "Have a great day and, for the record, I am truly sorry about my hair; it’s always been that way."

by Jerry Richardson | over 2 years ago | Read more

“Have a great day and, for the record, I am truly sorry about my hair; it’s always been that way.”

- Conan O’Brien

In_the_office_profile Watwet from Fadia [12/01/2010 23:05]

by Waheed Barghouthi | over 2 years ago | Read more

i am craving coffee

My120_135 help! не получается пушить репо на Gitorius

by Ruslan Voloshin | over 2 years ago | Read more

Соклубни,
подскажите, в чем может быть проблема!

Зарегистрировался на Gitorius, создал репо, загрузил паблик rsa-key
ssh-rsa AAAAB3NzaC1yc2EAAAABJQAAAIEA36jK7HjnwnxStR8X6KdCheH+AzjTJERMw7iUaJPUc1STur+EbrN3FBabSqL2NgCncfMbKWFg6Ni74tSf2rH6lU7Ha2zPe5GdYayUEx3y6lVC+WYFpw8A9XXXoIAGNX8Cam2tyGD1IFiXGVAHsRw5MSS/CTcuhXZ8h/EuyIwMQS8= rsa-key-20100112

он у меня сгенерился в таком формате, загрузился нормально - там в гиториусе стоит зеленая галка напротив ключа.

Настроил putty - указал свой логин и указал файл с приватным ключом. Не получается залогиниться по ssh - пишет "server refused our key". Сломал мозг, не понимаю в чем дело. При том fingerprint ключа одинаковый и в pageant и в gitorius, вроде это значит ключ прочитан правильно.

Еще что непонятно и нарпягает - на сайцте gitorius в форме добавления новго ключа есть такая фраза: The key should be in the format of: ssh-algorithm base64-content you@somehost

так вот я так разумею, что в моем ключе ssh-algorith это ssh-rsa, а вот you@somehost я что-то в своем ключе не вижу. Вместо этого есть rsa-key-20100112. И что это за somehost? gitorius.org что-ли?

такой ключ gitorious тоже принимает, но логин все равно не получается :(((
ssh-rsa AAAAB3NzaC1yc2EAAAABJQAAAIEA36jK7HjnwnxStR8X6KdCheH+AzjTJERMw7iUaJPUc1STur+EbrN3FBabSqL2NgCncfMbKWFg6Ni74tSf2rH6lU7Ha2zPe5GdYayUEx3y6lVC+WYFpw8A9XXXoIAGNX8Cam2tyGD1IFiXGVAHsRw5MSS/CTcuhXZ8h/EuyIwMQS8=
zhoran@gitorious.org
Git, Gitorius

Me PHP is a templating language

by Yoan Blanc | over 2 years ago | Read more

For my last project, I had to use PHP and managed to make it fun by —among other stuff— rewriting a templating tool. Templates was one of the first thing we did with Batiste for doSimple. It was qregexp based, not very flexible, ugly and for sure, inefficient.

Let’s redo this, keeping in mind that PHP is already a templating language.

<!DOCTYPE html>
<html lang=<?php echo $lang ?>>
<?php echo $html ?>
</html>

This is valid PHP, and can be seen as a template with two parameters: the language ($lang) and some html content ($html).

<?php
$lang = "en";
$html = "<h1>Hello World!</h1>";
// the file above
include("hello.php");

That was too easy. But it’s not very clean, imho because you cannot do anything with the result. Let’s do this a little bit better.

<?php
function template($template, $args) {
 extract($args);
 ob_start();
 include($template);
 $result = ob_get_contents();
 ob_end_clean();
 return $result;
}

echo template("hello.php",
              array("lang" => "en",
                    "html" => "<h1>Hello, World!</h1>"));

This way, you don’t pollute the global scope with variables and are able to reuse templates. It’s still very, very basic but will enable you to understand the final class Template that is used by bluespirit.ch. I’ll show you how it works but let you dive into the PHP code to understand it.

<?php
// templates is a directory
$tpl = new Template("templates");

echo $tpl->index(array("title" => "Hello",
                       "links" => array(1,2,3));

Now the templates, let’s start with the index (the function call above is in fact using __call).

<?php
$this->inherits("layout");
$this->block("head")
?>
<title><?php echo $title ?></title>
<?php
$this->endblock();
$this->block("body")
?>
<h1><?php echo $title ?></h1>
<ul>
<?php
foreach($links as $link):
?>
<li><?php echo $this->link(array("link" => $link)) ?></li>
<?php
endforeach
?>
</ul>
<?php
$this->endblock();

The layout, from which this template inherits.

<!DOCTYPE html>
<html lang=en>
<head>
<meta charset=utf-8>
<?php $this->block("head") ?>
<title>Untitled Document</title>
<?php $this->endblock() ?>
</head>
<body>
<?php
$this->block("body");
$this->endblock()
?>
</body>
</html>

and link, of course.

<?php
echo $link

Which could have been more complex.

That’s the very basics, the final one includes more features like some block control meaning you can no only override a block but also append or prepend some content which is very useful for the usual end of the page scripts. Another one that I like very much is some cache (using APC (or apc_alt) enabling avoiding regenerating a piece of layout everytime.

Having this kind of cache also means that you might ending up doing bad things in the templates (views) like SQL requests. This is for example used on the homepage of bluespirit.ch where the news are coming from a RSS feed parsed by Yahoo! Pipes. It doesn’t cURL it all the time.

All this in on GitHub, get it, fork it, fix it. And I’ve got one question for the PHP masters in the room, how do you do monkeypatching in PHP? (I know how much evil it is, but I promise that I won’t break anything)

Un des premiers outils que nous avions réalisés avec Batiste dans le cadre de nos débuts dosimplesques (pardonnez ce néologisme) a été un système de template. Nous en avons fait quelques-uns même. Tous reposent sur une syntaxe proche d’HTML, donc à base de commentaires remplacés à l’exécution.

C’était sans bien réaliser que PHP est déjà un langage de templating, intrinséquement. Pourquoi serait-il indispensable de mettre ce <?php sinon ? Ceci étant dit, voici un système de templates reposant sur ce fait-là et offrant quelques fonctionnalités sympathiques, telles que : l’héritage, les blocs, l’inclusion d’autres templates, le cache et même l’envoi de headers HTTP pour les plus bidouilleurs d’entre vous.

Le code ainsi que des exemples se trouvent sur GitHub, amusez-vous y.

Www Adult Games for Groups and Couples.

by Submit Articles SEO | over 2 years ago | Read more

The history tell us that the concept of celebrations based on sexual meanings, have his fundaments on the ancient rituals from the beginnings of human evolved societies as Greece, Rome, Egypt and the old Etruscans. Ass the studies reveals, the use of the modern “strap-on” (Sinless Touch Courtesy) where introduced by priestesses in rituals of [...]

Improving the UPS Homepage by Remembering Fitt’s Law

by Cody Robbins | over 2 years ago | Read more

UPS’s homepage contains a tiny button that’s hard to click, thus presenting a barrier to continuing on to the main site. By remembering Fitt’s law we make suggestions to improve the user experience by enlarging the button.

Me-300x225 I sure am relieved the police have got their pot back.

by Stephen Boisvert | over 2 years ago | Read more

POLICE RETRIEVE £500,000 WORTH OF CANNABIS AT AN INDUSTRIAL UNIT IN SMETHWICK POLICE in Smethwick have recovered an estimated £500,000 worth of cannabis from an industrial unit on the Bridge Industrial Estate in Bridge Street North. Retrieved and recovered? I wish these stoners would learn English. It would also be pretty nice if their web devs could [...]

Twitter_profile_pic_background_bigger_bigger SlickMap CSS — A Visual Sitemapping Tool for Web Developers

by Brent Sordyl | over 2 years ago | Read more

SlickMap CSS is a simple stylesheet for displaying finished sitemaps directly from HTML unordered list navigation. It’s suitable for most web sites – accommodating up to three levels of page navigation and additional utility links – and can easily be customized to meet your own individual needs, branding, or style preferences. (Link: SlickMap CSS — A [...]

Twitter_profile_pic_background_bigger_bigger SlickPlan – Sitemap Design | Creating Flowcharts

by Brent Sordyl | over 2 years ago | Read more

SlickPlan is a web-based sitemap/flowchart generator that allows for the creation of free sitemap and flowchart design. SlickPlan was handcrafted with PHP/MySQL and jQuery by the Dayton website design team at Atomic Interactive. (Link: SlickPlan – Sitemap Design | Creating Flowcharts)

Taqblack Tirando uma screenshot do GDM

by Eustáquio Rangel | over 2 years ago | Read more

Para tirar uma screenshot da sua tela de login no Ubuntu, faa o seguinte. Primeiro instale o xnest, se j no estiver instalado:

sudo apt-get install xnest

Depois execute o seguinte comando, que vai mostrar a tela de login dentro de uma janela, que pode ser capturada atravs da tecla Print Screen:

gdmflexiserver --xnest

Surf_s_up apelad: I cannot live on bread alone, so come with me. We'll live on bread together.

by Brian Del Vecchio | over 2 years ago | Read more

Brian Del Vecchio
apelad: I cannot live on bread alone, so come with me. We'll live on bread together. - http://twitter.com/apelad...

Jerry135x135 I Have No Talent - John Nunemaker

by Jerry Richardson | over 2 years ago | Read more

I Have No Talent - John Nunemaker:

A little background might help - John was named a “Ruby Hero” and given a decent-sized trophy for his contributions to the Ruby on Rails community last year at RailsConf. He is a bit too modest.

Headshot-blue Upgrading app from Rails 2.3.2 to 2.3.5

by Jonathan Linowes | over 2 years ago | Read more

I ran into a few snags upgrading ReviewRamp from Rails 2.3.2 to 2.3.5

My120_135 RE: RE: Новый раздел - Исходники

by Ruslan Voloshin | over 2 years ago | Read more

Я так понимаю что проблем с сервером у тебя нет. :)

My120_135 RE: Как обновить ruby с 1.8.6 до 1.8.7 ?

by Ruslan Voloshin | over 2 years ago | Read more

Ты лучше поставь ентерпрайз себе так будет лучше, тем более что примеров валом.

In_the_office_profile Watwet from Apie [12/01/2010 22:47]

by Waheed Barghouthi | over 2 years ago | Read more

Irrational fears give nuclear power a bad name, says Oxford scientist http://watwet.com/u/73f91c

My120_135 RE: RE: RE: Content-type text/javascript для каких цели

by Ruslan Voloshin | over 2 years ago | Read more

Ты у нас на столько давно я думал ты уже прохавался.
Тогда лучше тебе почитать книгу про яваскрипт, потому что в рельсах этого вроде не встречал в подробностях описанного.

My120_135 RE: RE: Thinking Sphinx и обновление индекса

by Ruslan Voloshin | over 2 years ago | Read more

Дело в том что есть стандартные индексы для таблицы, но сфинкс создает свои так что их надо и апдейтить зато они работают быстрее.
Если у тебя новые записи создаются очень часто то лучше по крону чем после каждой записи пересоздавать индекс

My120_135 RE: В поисках книжки

by Ruslan Voloshin | over 2 years ago | Read more

Хорошой литературы по руби нет. То ли дело такие авторы как Шилдт или братья Дейтелы. А это все пыль. Вкраце просто объясняется семантика языка и все. Никаких отклонений в сторону алгоритмизации для новичков.

A statement I reluctantly agree with

by Rafe Colburn | over 2 years ago | Read more

At this point, Stewart is doing more harm than good by giving people whom he thinks are liars and frauds a platform on his show. Ezra Klein on Jon Stewart’s interview with John “Banality of Evil” Yoo.

Caike_blog Autotesting PHP applications (and others)

by Carlos Henrique Souza | over 2 years ago | Read more

So you’ve probably heard of ZenTest/Autotest, right? In case you haven’t, it is a Ruby gem that (among other things) automatically runs your tests whenever it notices that a file in you project has changed. It’s a great productivity boost, because it saves you from having to run your tests each time you make a change [...]

Running FubuMVC on Mono (OSX)

by Tobin Harris | over 2 years ago | Read more

Whilst procrastinating furiously instead of attacking my huge workload, I decided to get FubuMVC reboot working on Mono/OSX and then write a blog post about it. The result is that you can get it running, although I had to do some hacks that aren’t going to work in production.

adamlogic: Heading to #codemash with @surfacedamage and @jondistad. Unfortunately, need to work on my talk during the drive.

by Adam McCrea | over 2 years ago | Read more

adamlogic: Heading to #codemash with @surfacedamage and @jondistad. Unfortunately, need to work on my talk during the drive.

Jerry135x135 Colts To Rest Starters For First Game Of Playoffs

by Jerry Richardson | over 2 years ago | Read more

Colts To Rest Starters For First Game Of Playoffs

In_the_office_profile Watwet from doublethink [12/01/2010 22:18]

by Waheed Barghouthi | over 2 years ago | Read more

CSS Flip 6.x-2.0 is released http://watwet.com/u/e717e5 #Drupal #Module (via @kharbat)

In_the_office_profile Watwet from Apie [12/01/2010 22:18]

by Waheed Barghouthi | over 2 years ago | Read more

The Words Of Physics http://watwet.com/u/a6a333

In_the_office_profile Watwet from Apie [12/01/2010 22:18]

by Waheed Barghouthi | over 2 years ago | Read more

Monsanto corn causes kidney and liver damage http://watwet.com/u/2e4e6d

264800182fa2015304bf5a0cf6d25085 Sparkline Some Interest With Ruby on Rails

by Ron Evans | over 2 years ago | Read more

Recently, I added some sparkline graphs to a Ruby on Rails application. A sparkline is a very small graphic that displays a large amount of information, typically shown over time, and usually embedded in some other text. Invented by the father of modern infographics Edward Tufte, the sparkline has become a fixture of many online applications that want to visually display some stats in a simple, integrated way.

When it come to adding sparklines into a Ruby on Rails application, there are a couple of different options. You can chart the data on the server, output being an image file. You can also chart the data on the client, with a couple of different JavaScript libraries as available options.

I started my plan, intending to implement my charts on the client-side. The project that appears to have the most flexibility, speed, and options, is an amazing jQuery plugin called jQuery Sparkline. Unfortunately, the project to which I needed to add the sparklines is a bit older, and does not use jQuery. As a result, I was not able to use jQuery Sparkline for this current project.

Another interesting JavaScript sparkline library is lethain's Sparkline.js, but it has not been updated in some time, and is not compatible with current Internet Explorer versions. There is also an interesting looking newer lib topfunky-sparkline-js but I have not tried it out yet.

So that brings us to server-side sparkline generation. If you are using ImageMagick/RMagick then @topfunky once again provides, with the Ruby sparklines gem. This gem provides lots of options for doing all sorts of fancy sparklines.

In my case, I am not using ImageMagick for anything else, so I did not want to install it just for this. What I really wanted was something much lighter-weight, and I was willing to accept a lot fewer options to get it.

It turns out that madrobby has written a library for generating very simple sparklines in pure Ruby code, called spark_pr. The project uses _why's pure Ruby implementation of a PNG generator to do the low-level work.

spark_pr has also spawned an interesting application of it from @technoweenie called Sparkplug, which is a Rack module that generates spaklines from CSV data on the fly, using Rack handlers and Rack caching.

Once I had seen Sparkplug's minimal elegance, it seemed spark_pr was the option for me. I decided to incorporate spark_pr into my application. Given that the app was written with a dedicated approach to keeping a clean RESTful interface, and that the database already contained the time-series data, it was quite easy to incorporate. Here is what I had to do:

Step 1: Put spark_pr.rb file into lib directory. I just grabbed the code from the repo, and dropped it into my project. You may decide to have a more sophisticated way to do it, such as using git submodules.

Step 2:
require "spark_pr"
in your controller

Step 3:
include Spark
in your controller

Step 4: Add PNG format to controller action that was already returning my time-series data, and return the sparkline PNG data:

Note that this controller action is already returning XML or JSON. PNG is just another format to be added, if you have a well-designed RESTful controller action.

Step 5: Put image_tag that requests the sparkline PNG image file into the view where you want it to appear, like this one:


Voila! Refresh that view and you should now be looking at your ultra-hipster-chic sparkline graph. It is surprising how much more information comprehension a person has, when they are seeing a visual representation of their data. Plus it looks cool.

Seancribbs-small smerl: for awesome!

by Sean Cribbs | over 2 years ago | Read more

Here's a quick hack with smerl to turn a fun() into a module function:

1> Fun = fun() -> ok end.
#Fun<erl_eval.20.67289768>
2> {env, [_,_,_,Forms]} = erlang:fun_info(Fun, env).
{env,[[],
      {value,#Fun<shell.7.115410035>},
      {eval,#Fun<shell.24.81953817>},
      [{clause,1,[],[],[{atom,1,ok}]}]]}
3> smerl:new(foo).
{meta_mod,foo,undefined,[],[],false}
4> Mod = smerl:new(foo).
{meta_mod,foo,undefined,[],[],false}
5> {ok, Mod2} = smerl:add_func(Mod, {function,1,bar,0,Forms}, true).
{ok,{meta_mod,foo,undefined,
              [{bar,0}],
              [{function,1,bar,0,[{clause,1,[],[],[{atom,1,ok}]}]}],
              false}}
6> smerl:compile(Mod2, [{outdir, "ebin"}]).
ok
7> l(foo).
{module,foo}
8> foo:bar().
ok

2d5686cf2210a53db5a6888fcd0a87a9 I could get used to this working from home thing.

by Mike Auclair | over 2 years ago | Read more

I could get used to this working from home thing.

Zoom in and enhance….

by Paul Watson | over 2 years ago | Read more

Zoom in and enhance.

adamlogic: @muncman @mikedoel Also better make sure your Apple Remote is paired with your machine.

by Adam McCrea | over 2 years ago | Read more

adamlogic: @muncman @mikedoel Also better make sure your Apple Remote is paired with your machine.

6257 Gerade die 1620. Fratze auf #dailyfratze hochgeladen: http://dailyfratze.de/michael/2010/1/12

by Michael Simons | over 2 years ago | Read more

Michael
Gerade die 1620. Fratze auf #dailyfratze hochgeladen: http://dailyfratze.de/michael...

6257 michael am 12. Januar 2010

by Michael Simons | over 2 years ago | Read more

Michael
michael am 12. Januar 2010 - http://dailyfratze.de/michael...
michael am 12. Januar 2010

245186169_46c171be89_m_d Tokyo’s N Building

by Marcel Molina Jr | over 2 years ago | Read more

Tokyo’s N Building

2010년 1월 12일

by Heungseok Do | over 2 years ago | Read more

이 글은 꽃띠앙님의 2010년 1월 12일의 미투데이 내용입니다.

1teamalps1cmdejgea7p7okx_400 "More startups fail from a lack of customers than from a failure of product development."

by Dan Croak | over 2 years ago | Read more

“More startups fail from a lack of customers than from a failure of product...

20090428-q927cspt8sx11r8d4swc6qb3fg "Controllers aren’t horrible for a FPS. […] But a mouse is just on a different level...."

by Adam Bair | over 2 years ago | Read more

“Controllers aren’t horrible for a FPS. […] But a mouse is just on a different level. It’s like the difference between masturbation and sex. The first is serviceable, but the second is what everyone wants.”

- optimism (via reddit)

245186169_46c171be89_m_d coterie: A small group of p...

by Marcel Molina Jr | over 2 years ago | Read more

co•te•rie
[koh-tuh-ree]noun
A small group of people with shared interests or tastes, esp. one that is exclusive of other people.

245186169_46c171be89_m_d Be happy you’re not

by Marcel Molina Jr | over 2 years ago | Read more

Be-happy-youre-not

Be happy you’re not



Tell us what you think of the new BlogSphere feature. We are continually looking to improve and update the functionality based on your feedback.

Job Board

Job Boards
Find your next Ruby on Rails project or job.
Exclusive content, regularly updated - onsite and tele-working positions listed.

View the opportunities

Latest from the Weblog

Stefan Schüßler:

Stefan is a very nice guy and i really enjoy to work with him :)

- Sbubble D.R, Germany