John Gagliardi

Month

February 2011

10 posts

Remove a remote branch with git

This is a quick hitter but to remove a remote branch lets say on github you would do something like this.

git push origin :YOUR_REMOTE_BRANCH

Feb 17, 2011
#git
Ben Nadel - Back to the Fusion

Pretty funny stuff from Ben Nadel!

Feb 17, 2011
#coldfusion
Feb 17, 20116 notes
#mongodb #seven languages in seven weeks
jQuery .animate() with easing

Everyone knows how awesome jQuery is and here is another quick example. The jQuery Easing plugin allows you to add rad animations very easily.

var percentBar = $(entry).find("#percentBar"); percentBar.animate({"width": percentRounded + "%"}, { duration: 3000, easing: 'easeOutBounce' })

I have a project with some simple css bar charts. When a bar value updates I call the .animate() jQuery function and use the ‘easeOutBounce’ property provided by the easing plugin. This give my bar a nice bounce to it when the value is updated.

Feb 15, 20111 note
#jQuery
ColdFusion varScoper

I know this is kinda old but if you haven’t used ColdFusion varScoper then you should give it a try. It will ensure that all your variables are properly scoped. Make sure to note that if will catch variables that are commented out and also any argument variables that are not preceded with “argument” will give a false positive.

Feb 14, 2011
#coldfusion
Mango Blog Plugins

I have transfered all of my Mango Blog plugins to my github account.  Feel free to use them however you would like.

Feb 13, 20111 note
#ColdFusion #MangoBlog
Feb 13, 2011
#beer
Ruby on Rails Render Partial

With Rails getting a lot of love recently I wanted to give it a shot.  One of the first cool things I have found is called render partial.  Here are a couple code snippets of what I learned. I am assuming you know a little bit about rails in the first place.

First I made a home controller with a index function.  Then I parsed my tumblr rss feed and set a variable called “posts”. 

class HomeController < ApplicationController

def index @posts = RSS::Parser.parse(open('http://johngag.tumblr.com/rss').read, false).items

end

end

After that I made a partial file called _post.html.erb which outputs the post title and links to the post.

<%= link_to post.title, post.link, :target => "_parent" %>

Finally in my index.html.erb view I output the rails magic. In one line of code rails loops through all the posts (or in my case I told it to loop over first 5) and output the posts according to the partial created.  This is very DRY (Dont Repeat Yourself) and I love writing less code.

<%= render :partial => "home/post", :collection => @posts.first(5) %>

I am very happy so far with how easy and magical rails has been. I cant wait to dive into writing less code to do more. 

Feb 13, 20111 note
#rails #ruby
Rails for Zombies → railsforzombies.org

For a quick introduction to rails I recommend zipping through the 8 chapters :)

Feb 13, 20111 note
#rails #ruby
Welcome to the home of John Gag

This is my new blog home! I have tried various blogging applications but tumblr is just the best.

I will be blogging about various topics but I will be focusing mainly on my web development adventures. Do not be alarmed if you see a post or two about my beer brewing hobby though :)

Hope you enjoy,

John

Feb 13, 2011
Next page →
2011
  • January
  • February 10
  • March 2
  • April 7
  • May 1
  • June 3
  • July 1
  • August 4
  • September 1
  • October
  • November 1
  • December