<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Admoo Labs &#187; Web Design</title>
	<atom:link href="http://blog.admoolabs.com/category/webdev/design/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.admoolabs.com</link>
	<description>Bringing fun back to the web.</description>
	<lastBuildDate>Fri, 14 Jan 2011 09:53:16 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.6</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>G-Edit and Shell to make editing multiple views easier</title>
		<link>http://blog.admoolabs.com/g-edit-and-shell-to-make-editing-multiple-views-easier/</link>
		<comments>http://blog.admoolabs.com/g-edit-and-shell-to-make-editing-multiple-views-easier/#comments</comments>
		<pubDate>Tue, 03 Mar 2009 11:01:03 +0000</pubDate>
		<dc:creator>Eumir Gaspar</dc:creator>
				<category><![CDATA[Web Design]]></category>
		<category><![CDATA[Web Development]]></category>

		<guid isPermaLink="false">http://blog.admoolabs.com/?p=74</guid>
		<description><![CDATA[I recently was given a task to change alt tags in ALL of our companies images for better SEO purposes(I do think it won&#8217;t impact that much, but I guess they&#8217;re thinking any additional impact is better than nothing). I was given an excel file with about 300 images with their current alt tags and [...]]]></description>
			<content:encoded><![CDATA[<p>I recently was given a task to change alt tags in ALL of our companies images for better SEO purposes(I do think it won&#8217;t impact that much, but I guess they&#8217;re thinking any additional impact is better than nothing). I was given an excel file with about 300 images with their current alt tags and their proposed replacements. Yes, another copy and paste task.</p>
<p>What really blows is I don&#8217;t have a way of knowing where ALL the instances of the images are, so I had to use my now current favorite shell command to search where a said image is placed in a view:</p>
<p><code>grep -r -i imagename *</code></p>
<p>What that does is look which file and line in that file that the imagename string is mentioned. I usually just look for the name itself, and not the extension and the sub-folder, so to look for logo.jpg, I just put</p>
<p><code>grep -r -i logo *</code></p>
<p>That returns all the files where logo is mentioned(so I guess you&#8217;ll also get non-image results). What&#8217;s good about this is that it looks for both the instances when the image was rendered using <code>&lt;img src&gt;</code> or <code>&lt;%= image_tag %&gt;</code></p>
<p>Seeing my first search resulted in 11 hits(I think the options -r -i of grep searches incrementally so it will also look in all sub-folders of the directory you are in), it occurred to me that this might take a while, as I also had to look for all the files, etc. I asked my friend to help in some shell-fu and here&#8217;s what we came up with:</p>
<p><code>gedit `grep -r -i -l imagename *`</code></p>
<p>What does this do? Simple, the -l option just lists the filename of the file where imagename was seen(as opposed to including the actual line where it was seen), and the grep enclosed in &#8220; means that the output will be a string&#8230;which in turn is sent to gedit. The result? It opens up all the files that contains imagename and that my friends, made my life a wee bit easier in changing the alt tags in all the instances of a said image.</p>
<p>*EDIT:<br />
By the way, I know there is an easier way, like maybe replace all instances of said string in all files or something, but I haven&#8217;t found out about it yet. If I do, I&#8217;ll be sure to make a new post about it <img src='http://blog.admoolabs.com/wp-includes/images/smilies/icon_razz.gif' alt=':P' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://blog.admoolabs.com/g-edit-and-shell-to-make-editing-multiple-views-easier/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Rails for Designers 101 &#8211; Step by Step Version</title>
		<link>http://blog.admoolabs.com/rails-for-designers-101-step-by-step-version/</link>
		<comments>http://blog.admoolabs.com/rails-for-designers-101-step-by-step-version/#comments</comments>
		<pubDate>Tue, 30 Dec 2008 11:39:51 +0000</pubDate>
		<dc:creator>Eumir Gaspar</dc:creator>
				<category><![CDATA[Ruby on Rails]]></category>
		<category><![CDATA[Tutorial]]></category>
		<category><![CDATA[Web Design]]></category>
		<category><![CDATA[Web Development]]></category>

		<guid isPermaLink="false">http://blog.admoolabs.com/?p=40</guid>
		<description><![CDATA[This is more of a &#8216;tutorialized&#8217; version of my previous post. Here, I&#8217;ll be sharing how I made my &#8216;portfolio/haml converter&#8217; rails application, since I unfortunately assumed that anyone reading that post also knew what I knew. This time though, I&#8217;ll be assuming nothing, just that you are a designer and you just want to [...]]]></description>
			<content:encoded><![CDATA[<p>This is more of a &#8216;tutorialized&#8217; version of my previous post. Here, I&#8217;ll be sharing how I made my &#8216;portfolio/haml converter&#8217; rails application, since I unfortunately assumed that anyone reading that post also knew what I knew. This time though, I&#8217;ll be assuming nothing, just that you are a designer and you just want to try coding in Haml for a change(good for you!) even if you don&#8217;t know squat about rails.</p>
<p>For starters, if you don&#8217;t have Rails yet, I suggest either installing Rails the hardcore way, or take the easy way out like I did: just download <a href="http://rubyforge.org/projects/instantrails/">InstantRails</a>. Okay, after you&#8217;re done with that part(I&#8217;ll be assuming you also took the easy way out) just unzip that into your root directory(I&#8217;m using Windows *gasp* so mine is located at C:/Instantrails/)</p>
<p>Now, all you have to do is bring up a command line(windows key + r, then type cmd), go to your Instantrails folder(type &#8216;C:/Instantrails/&#8217;) then type &#8216;use_ruby&#8217;. You&#8217;ll know you did the right thing when the directory changes to C:/Instantrails/rails_apps(just realized it&#8217;ll be better with screenshots&#8230;but I&#8217;ll do that later)</p>
<p>OKay, next in line is installing haml. Ready? Just type:</p>
<p><code>gem install haml</code></p>
<p>That&#8217;s it! Haml should be automatically downloading now. As you wait for that one, you can open up a new command line, go to your IR(due to laziness I&#8217;ll be calling Instantrails IR from now on) folder again, type use_ruby again and then type</p>
<p><code>rails myhamlizedportfolio</code></p>
<p>Actually you can name it anything you want. Doesn&#8217;t really matter(I sugest you pick a short name though). This will effectively create a blank rails app for you. And by that I mean it will create a folder named myhamlizedportfolio in your rails_app folder, complete with all the folders needed for a blank rails app. Next would be to install haml as a plugin for your portfolio app(you should still be in C:/Instantrails/rails_app when you do this):</p>
<p><code>haml --rails myhamlizedportfolio</code></p>
<p>Easy, right? Next, you just have to tell rails that you won&#8217;t be needing any database of sorts. So goand open the myhamlizedportfolio/config folder. Open environment.rb(with your favorite text editor &#8211; notepad) and look for the following lines</p>
<pre class="brush: ruby;"># Skip frameworks you're not going to use. To use Rails without a database  
# you must remove the Active Record framework.
# config.frameworks -= [ :active_record, :active_resource, :action_mailer ]</pre>
<p>Just take out the &#8216;#&#8217; of the third line like so:</p>
<pre class="brush: ruby;"># Skip frameworks you're not going to use. To use Rails without a database
# you must remove the Active Record framework.
config.frameworks -= [ :active_record, :active_resource, :action_mailer ]</pre>
<p>Save this and close the file. Delete database.yml in that same folder by the way &#8211; you won&#8217;t be needing that. Next up is to fix your routes(if you want to understand what you&#8217;re actually doing, I suggest learning basic rails first like a good citizen, but if you can&#8217;t be bothered, then just follow these steps and believe it will work <img src='http://blog.admoolabs.com/wp-includes/images/smilies/icon_razz.gif' alt=':P' class='wp-smiley' /> ). Open up routes.rb with notepad(it&#8217;s still in the config folder) and add this line right after the first line like so:</p>
<pre class="brush: ruby;">
ActionController::Routing::Routes.draw do |map|
map.connect 'projects/:id', :controller =&gt; 'projects', :action =&gt; 'index'
 </pre>
<p>That just basically means that to access your projects all you have to do is go to http://localhost:3000/projects/projectnamehere. More on that later. For now, save and exit again and you&#8217;re done with the config folder. We&#8217;re almost there! </p>
<p>Now go back to your command line and while in your project directory(in our case, myhamlizedportfolio) and type</p>
<p><code>ruby script/generate controller projects</code></p>
<p>This will generate some files but what we really want to focus on is the newly generated projects_controller.rb located in myhamlizedportfolio/app/controllers. Open this file up with notepad, as usual, and well, just replace all the code there with this:</p>
<pre class="brush: ruby;">
class ProjectsController &lt; ApplicationController
def index
render :action =&gt; &quot;#{params[:id]}/index&quot;
end
end
</pre>
<p>Don&#8217;t worry if you don&#8217;t understand. That&#8217;s just a &#8216;continuation&#8217; of what we did with routes.rb, basically telling our app that going to http://localhost:3000/projects/projectnamehere means it should render the page with the same name located in your views(again, more on that soon).</p>
<p>Actually you&#8217;re done setting up. You can now start coding with Haml. To start, let&#8217;s make a design project named RedHelloWorld. Go to your views folder(myhamlizedportfolio/app/views) and make a new directory named RedHelloWorld. Open up notepad again and type these:</p>
<pre class="brush: ruby;">
!!!

%html{:xmlns =&gt; &quot;http://www.w3.org/1999/xhtml&quot;, &quot;xml:lang&quot; =&gt; &quot;en&quot;, :lang =&gt; &quot;en&quot;}
  = yield :layout
</pre>
<p>If you have reviewed <a href="http://haml.hamptoncatlin.com/">Haml</a>, that just basically creates the basic headers for your html page. Save that as application.haml and save it in the views/layouts folder(also delete application.html there if it exists). Create a new document yet again and type the following:</p>
<pre class="brush: ruby;">
%head
  %meta{&quot;http-equiv&quot; =&gt; &quot;content-type&quot;, :content =&gt; &quot;text/html;charset=UTF-8&quot;}
  %title hamlicious home!
  = stylesheet_link_tag 'demo'

  %body
    %h1.red HELLO WORLD!
</pre>
<p>Just by looking at the code, you&#8217;ll already know that Haml really makes things easier for you. A lot of time is saved since you won&#8217;t be needing to type the appropriate closing tags for each div, or other html tag out there. Save that file as index.haml and save it in views/RedHelloWorld (yup, create a folder with that name).</p>
<p>Next up, is your sass(css) file. Open up a new text file again and type:</p>
<pre class="brush: ruby;">
.red
  :color #ff0000
</pre>
<p>Save that as demo.sass and save it in myhamlizedportfolio/public/stylesheets/sass/(you&#8217;ll have to create a sass folder). While you&#8217;re at it, also delete the index.html in your public/ folder. And now all you have to do is run and test your app! Go to your command line(yet again) and after use_ruby and going to your project directory, just type </p>
<p><code>ruby script/server</code></p>
<p>Wait til ou see the lines:</p>
<p>** Mongrel available at 0.0.0.0:3000<br />
** Use CTRL-C to stop.</p>
<p>And that&#8217;s it. You can now access your demo by opening up your browser and going to http://localhost:3000/projects/RedHelloWorld</p>
<p>Hopefully that&#8217;ll work. Any problems, leave a comment <img src='http://blog.admoolabs.com/wp-includes/images/smilies/icon_razz.gif' alt=':P' class='wp-smiley' />  Oh and before I forget, if you need the html and css files(like I do &#8211; I just like coding in Haml/Sass) just view the page, view the source and copy paste it in a blank document and save it as .html(in another directory of course). Get the .css file that will be generated in myhamlizedportfolio/public/stylesheets/ and use that for the css file of your project. Enjoy!</p>
<p>More on customizing this app sometime in the future. (namely how to make a &#8220;homepage&#8221; where you have a list of all your hamlized projects.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.admoolabs.com/rails-for-designers-101-step-by-step-version/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Rails for Designers &#8211; Using Haml/Sass for all projects</title>
		<link>http://blog.admoolabs.com/rails-for-designers-using-haml-sass-for-all-projects/</link>
		<comments>http://blog.admoolabs.com/rails-for-designers-using-haml-sass-for-all-projects/#comments</comments>
		<pubDate>Sun, 28 Dec 2008 23:48:03 +0000</pubDate>
		<dc:creator>Eumir Gaspar</dc:creator>
				<category><![CDATA[Ruby on Rails]]></category>
		<category><![CDATA[Web Design]]></category>
		<category><![CDATA[Web Development]]></category>

		<guid isPermaLink="false">http://blog.admoolabs.com/?p=30</guid>
		<description><![CDATA[I have recently acquired a newfound drive for designing sites(as opposed to my earlier desire to be a great design/backend mediator). As of now, due to some reent developments, I am the main designer for most of our projects, not to mention some of which are personal or freelance related. One pet peeve I had [...]]]></description>
			<content:encoded><![CDATA[<p>I have recently acquired a newfound drive for designing sites(as opposed to my earlier desire to be a great design/backend mediator). As of now, due to some reent developments, I am the main designer for most of our projects, not to mention some of which are personal or freelance related. One pet peeve I had though was the diversity of my projects: meaning some were in rails(of course I was happy with fixing views and adding some javascript-fu), php, and some, just plain XHTML/CSS.</p>
<p>With that said, things can get pretty messy when multiple projects are at hand and I have to shift continually from regular XHTML/CSS coding and HAML/SASS. Though it is not a great hindrance, having to keep remembering which language I was using was kinda annoying. Add to the fact that I work twice(or thrice) as fast using HAML/SASS and the tiny nuisance becomes a glaring problem(for me that is).</p>
<p>At first, I made a semi-solution. A compromise of sorts: since I use the ever cool <a title="Elements CSS Framework" href="http://elements.projectdesigns.org/" target="_blank">Elements CSS framework</a>(actually I just use the general html structure and a modified reset.css which I have discussed with the author, Ben Henschel), my html is usually almost ready-made so my usual focus is just the css file. For projects that used Rails(I still didn&#8217;t have a solution for ones that didn&#8217;t) but not Haml, I just installed Haml on my part, and continued developing with Sass. Since Sass generates a .css file, that&#8217;s the one I usually push in repos(if the client can&#8217;t be bothered with installing Haml).</p>
<p>But that was just for Rails projects. The problem lies with normal design projects or ones that used PHP. Recently, I had another solution(I doubt this is the most efficient though): make a blank rails app and keep using Haml/Sass for myself and when done with coding the design, I just do a view source, copy-paste the whole thing in a blank html file, modify the paths for the css and javascripts, then just copy the images/stylesheets/javascripts folders in my public/ folder. Nifty!</p>
<p>It was a good thing for me, since now, I can just keep coding in Haml and Sass to my heart&#8217;s content. Thing is, I just realized I just can&#8217;t keep making blank rails apps for each project! So the plan was to separate the projects in self-titled folders and just use some routes.rb and controller magic suggested by my friend Greg:</p>
<p>In routes.rb:</p>
<pre class="brush: ruby;">
map.connect 'projects/:id', :controller =&gt; 'projects', :action =&gt; 'index'
</pre>
</p>
<p>and in my single controller named projects_controller.rb:</p>
<pre class="brush: ruby;">
def index
render :action =&gt; &quot;#{params[:id]}/index&quot;
end
</pre>
</p>
<p>With that, I can just go to say /projects/projectA and it will then render projectA. This also works as a portfolio and future-reference of sorts for me, which is excellent. Now I only need to think of a good way to organize the images and the stylesheets(especially the javascripts) so they won&#8217;t interfere with each other but basically, I&#8217;m just planning to put them in separate folders too(except for reset.css and <a href="http://jquery.com/">jquery.js </a>of course &#8211; every project needs that!)</p>
<p>Extra note:<br />
Forgot to mention that I had to add </p>
<p>
<pre class="brush: ruby;">
config.frameworks -= [ :active_record, :active_resource, :action_mailer ]
</pre>
</p>
<p>since I wasn&#8217;t using any db.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.admoolabs.com/rails-for-designers-using-haml-sass-for-all-projects/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

