Skip to content

Instantly share code, notes, and snippets.

$ cd ~/Downloads/redis-2.4.14
$ make test
$ make
@johnnyeric
johnnyeric / gist:4722324
Last active December 12, 2015 05:29
Ruby on Rails helper methods for creating social buttons at the view
#Gets the url, the width and height like integer.
def facebook_button(url,width,height)
"<iframe src=\"http://www.facebook.com/plugins/like.php?href=#{url}&;layout=standard&<br>
show_faces=false&width=380&action=like&colorscheme=light&height=#{width}&locale=pt_BR\" scrolling=\"no\" frameborder=\"0\" style=\"border:none; overflow:hidden; width:#{width}px; height:#{height}px;\" allowTransparency=\"true\"></iframe>".html_safe
end
#gets the actual url
def twitter_button
"<a href=\"https://twitter.com/share\" class=\"twitter-share-button\" data-lang=\"pt\">Tweetar</a>
<script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0];if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=\"//platform.twitter.com/widgets.js\";fjs.parentNode.insertBefore(js,fjs);}}(document,\"script\",\"twitter-wjs\");</script>".html_safe
@johnnyeric
johnnyeric / gist:3753909
Created September 20, 2012 04:01 — forked from thehydroimpulse/gist:2872907
A Laravel task generator. Models, Migrations and Controllers.
<?php
/**
* @copyright 2012 TheHydroImpulse, Daniel Fagnan
* @version 0.1
* @todo Add an overwite ability. Among other things.
* @note Use this as you wish. Extend it, Mash it. Enjoy it.
*/