Skip to content

Instantly share code, notes, and snippets.

View rafaelsales's full-sized avatar
💻
Compiling...

Rafael Sales rafaelsales

💻
Compiling...
View GitHub Profile
# Variation on Hashrocket's script for managing the git process
# as documented here: http://reinh.com/blog/2008/08/27/hack-and-and-ship.html
# Create shell scripts out of each of these, put them in your path (~/bin for example)
# chmod 755 them and use like this:
#
# This version of hack is totally different than Hackrockets. I feel that hack implies
# that you are getting started, not finishing up. sink is Hashrockets hack.
#
# $ hack branch_name
# Test and Implement until done
@bradmontgomery
bradmontgomery / rvm_apache_passenger.txt
Created January 10, 2012 04:45
RVM + Apache + passenger setup for Ubuntu
# Install rvm system-wide
bash -s stable < <(curl -s https://raw.github.com/wayneeseguin/rvm/master/binscripts/rvm-installer )
# Update the packages
apt-get update
apt-get upgrade
apt-get install build-essential
# get the packages required by ruby
rvm pkg install zlib
@henrik
henrik / README.markdown
Created June 26, 2012 07:30
This is how we test that all translation keys match up between locales, in Rails.

This is how we test that all translation keys match up between locales.

Stuff that only goes in one locale (such as an admin section) or that can't be translated yet (if you use external translators) can simply go in files that don't match the path "config/locales/??.yml", like "config/locales/wip.fo.yml".

@rafaelsales
rafaelsales / jQueryfy_for_Tampermonkey
Created December 15, 2012 15:22
jQueryfy is a Tampermonkey <http://goo.gl/19Fxy> script for enabling jQuery in any page dynamically. The script is published at http://userscripts.org/scripts/show/154225 where you can easily install in your Tampermonkey. Whenever the script is active, the jQuery is loaded after the page loads. If the page has already defined jQuery, it's not lo…
// ==UserScript==
// @name jQueryfy
// @namespace http://rafasales.com
// @version 0.1
// @description Loads jQuery in any page
// @match http*://*
// @copyright 2012+, Rafael Sales
// ==/UserScript==
if (typeof(unsafeWindow.jQuery) != 'undefined') {
return;
@lehnerpat
lehnerpat / payload.json
Created July 6, 2013 13:48
example webhook payload
{
"after":"98248f0e892ce4e4e37411730ac98b53f2aa1261",
"base_ref":"refs/heads/br2",
"before":"0000000000000000000000000000000000000000",
"commits":[
],
"compare":"https://github.com/nevik/testrepo/compare/tag2",
"created":true,
"deleted":false,
@fieldform
fieldform / bookmarks.html
Created September 13, 2013 17:13
iPhone Bookmarklets
<DT><H3 FOLDED>iPhones</H3>
<DL><p>
<DT><A HREF="javascript:open(location,'iPhone:portrait','innerWidth='+(640+15)+',innerHeight='+(1136+15)+',scrollbars=yes');">iPhone 5 - Portrait</A>
<DT><A HREF="javascript:open(location,'iPhone:landscape','innerWidth='+(1136+15)+',innerHeight='+(640+15)+',scrollbars=yes');">iPhone 5 - Landscape</A>
<DT><A HREF="javascript:open(location,'iPhone:portrait','innerWidth='+(640+15)+',innerHeight='+(960+15)+',scrollbars=yes');">iPhone 4 - Portrait</A>
<DT><A HREF="javascript:open(location,'iPhone:landscape','innerWidth='+(960+15)+',innerHeight='+(640+15)+',scrollbars=yes');">iPhone 4 - Landscape</A>
<DT><A HREF="javascript:open(location,'iPhone:portrait','innerWidth='+(320+15)+',innerHeight='+(480+15)+',scrollbars=yes');">iPhone 3 - Portrait</A>
<DT><A HREF="javascript:open(location,'iPhone:landscape','innerWidth='+(480+15)+',innerHeight='+(320+15)+',scrollbars=yes');">iPhone 3 - Landscape</A>
<DT><A HREF="http://www.iphoneresolution.com/">What's the iPhone Screen Resolut
<DT><H3 FOLDED>iPhones</H3>
<DL><p>
<DT><A HREF="javascript:open(location,'iPhone:portrait','innerWidth='+(640+15)+',innerHeight='+(1136+15)+',scrollbars=yes');">iPhone 5 - Portrait</A>
<DT><A HREF="javascript:open(location,'iPhone:landscape','innerWidth='+(1136+15)+',innerHeight='+(640+15)+',scrollbars=yes');">iPhone 5 - Landscape</A>
<DT><A HREF="javascript:open(location,'iPhone:portrait','innerWidth='+(640+15)+',innerHeight='+(960+15)+',scrollbars=yes');">iPhone 4 - Portrait</A>
<DT><A HREF="javascript:open(location,'iPhone:landscape','innerWidth='+(960+15)+',innerHeight='+(640+15)+',scrollbars=yes');">iPhone 4 - Landscape</A>
<DT><A HREF="javascript:open(location,'iPhone:portrait','innerWidth='+(320+15)+',innerHeight='+(480+15)+',scrollbars=yes');">iPhone 3 - Portrait</A>
<DT><A HREF="javascript:open(location,'iPhone:landscape','innerWidth='+(480+15)+',innerHeight='+(320+15)+',scrollbars=yes');">iPhone 3 - Landscape</A>
<DT><A HREF="http://www.iphoneresolution.com/">What's the iPhone Screen Resolut
@staltz
staltz / introrx.md
Last active July 22, 2024 09:31
The introduction to Reactive Programming you've been missing
@denzildoyle
denzildoyle / SEO.md
Last active July 11, 2024 22:54
I short list of SEO tips and tricks I have learned over time

SEO

In this list, I will be typically be talking SEO as it relates to Google because Google will likely account for the vast majority of your inbound search traffic. Additionally, if you rank highly on Google, you will probably do well on other search engines anyway. Just like in football if you could play in the Major league you would most likely kill it in the minor league I would begin by explaining why SEO is important talk a little bit about what SEO is about and talk about how those concepts relate to the world wide web. Then talk about some of the things you could do to optimize your site from top to bottom of a typical webpage.

Why it's important

  • When you want to hide something on google put it on the second page. #SEO @searchdecoder
  • Winner takes almost everything
  • More than 80 percent of shoppers research big purchases online first
  • Opertunity for business
  • 88% Of Consumers Trust Online Reviews As Much As Personal Recommendations
  • 72% Of Consumers Say That Positive Reviews Make Them T
@tkrajcar
tkrajcar / newrelic-metaprogramming-challenge.md
Created November 21, 2014 18:56
New Relic Ruby Metaprogramming Challenge

Your challenge, should you accept it, is to write a Ruby library that will modify an existing program to output the number of times a specific method is called.

You solution library should be required at the top of the host program, or via ruby's -r flag (i.e. ruby -r ./solution.rb host_program.rb).

Your solution library should read the environment variable COUNT_CALLS_TO to determine the method it should count. Valid method signatures are Array#map!, ActiveRecord::Base#find, Base64.encode64, etc.

Your solution library should count calls to that method, and print the method signature and the number of times it was called when the program exits.

Also, your solution should have a minimal impact on the program's running time. set_trace_func is a no-go...