Skip to content

Instantly share code, notes, and snippets.

View rafael's full-sized avatar
💭
Vitess

Rafael Chacon rafael

💭
Vitess
View GitHub Profile
rsadasdada
var timeout_setter=0;
var hideExpandableClassElements = function (){
var allPageTags=document.getElementsByTagName("*");
//Cycle through the tags using a for loop
for (i=0; i<allPageTags.length; i++) {
//Pick out the tags with our class name
if (allPageTags[i].className=="entry-content notfirst") {
//Manipulate this in whatever way you want
@rafael
rafael / install_homebrew.rb
Created July 5, 2011 15:10 — forked from mxcl/install_homebrew.markdown
Installs Homebrew to ./homebrew so you don't need sudo to `brew install`
#!/usr/bin/ruby
#
# This script installs to ./.homebrew only. To install elsewhere you can just
# untar https://github.com/mxcl/homebrew/tarball/master anywhere you like.
#
#
# 30th March 2010:
# Added a check to make sure user is in the staff group. This was a problem
# for me, and I think it was due to me migrating my account over several
# versions of OS X. I cannot verify that for sure, and it was tested on
@rafael
rafael / gist:1142468
Created August 12, 2011 16:57
Spork problem
I'm having the following it issue. When I run the specs using spork the following error arises:
You might have expected an instance of ActiveRecord::Base.
The error occurred while evaluating nil.[]
I read the following post:
http://groups.google.com/group/sporkgem/browse_thread/thread/46b8358008046986
I saw something related to a monkey patch with the ext/ruby-debugger. It wasn't really related to my issue but I tried to run the specs with --debugger and the error disappears.
@rafael
rafael / set_hostname.sh
Created August 18, 2011 18:43
Configure hostname script
#!/bin/bash
DOMAIN=noomii.com
HOSTNAME=hotfix
IPV4='184.73.226.144'
# Set the host name
hostname $HOSTNAME
echo $HOSTNAME > /etc/hostname
@rafael
rafael / puppet-agent
Created January 13, 2012 17:55
puppet-agent init script
#! /bin/sh
### BEGIN INIT INFO
# Provides: puppetd
# Required-Start: $network $named $remote_fs $syslog
# Required-Stop: $network $named $remote_fs $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
### END INIT INFO
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
@rafael
rafael / gist:2009670
Created March 10, 2012 01:45
pre-commit
#!/bin/sh
#
bash -c "cd /noomii && bundle exec rake"
if [ $? != 0 ]
then
echo "Error: The commit you are trying to submit doesn't pass the tests. Check this before commiting "
exit 1
fi
if git-rev-parse --verify HEAD >/dev/null 2>&1 ; then
@rafael
rafael / tumblr_custom_404
Created March 28, 2012 03:10
Custom tubmlr 404 page
<script type="text/javascript" src="https://www.google.com/jsapi"></script>
<script type="text/javascript">
google.load("jquery", "1.7.1");
</script>
<script type="text/javascript">
$(document).ready(function() {
var text_posts = $('.post-type-text')
var not_found_title = $('.post-type-text').find('.post-content').children('h3').text()
if(text_posts.length == 1 && not_found_title == "Not Found"){
@rafael
rafael / test45
Created August 18, 2012 21:32
test43
if (typeof jQuery === 'function') {
var oQuery = jQuery.noConflict(true);
}
/*!
* jQuery JavaScript Library v1.7.2
* http://jquery.com/
*
* Copyright 2011, John Resig
* Dual licensed under the MIT or GPL Version 2 licenses.
if (typeof jQuery === 'function') {
var oQuery = jQuery.noConflict(true);
}
/*!
* jQuery JavaScript Library v1.7.2
* http://jquery.com/
*
* Copyright 2011, John Resig
* Dual licensed under the MIT or GPL Version 2 licenses.