Skip to content

Instantly share code, notes, and snippets.

View gabrielmansour's full-sized avatar

Gabriel Mansour gabrielmansour

View GitHub Profile
Last login: Mon Nov 23 13:41:41 on ttys004
nulayer-devs-mac-mini:~ gabriel$ which ruby
/Users/gabriel/.rvm/ruby-1.8.7-p174/bin/ruby
nulayer-devs-mac-mini:~ gabriel$ which gem
/Users/gabriel/.rvm/ruby-1.8.7-p174/bin/gem
nulayer-devs-mac-mini:~ gabriel$ gem install nokogiri
Building native extensions. This could take a while...
ERROR: Error installing nokogiri:
ERROR: Failed to build gem native extension.
nulayer-devs-mac-mini:nokogiri gabriel$ cat mkmf.log
nokogiri_find_header: checking for iconv.h in /opt/local/include/,/opt/local/include/libxml2,/opt/local/include,/opt/local/include,/opt/local/include/libxml2,/usr/local/include,/usr/local/include/libxml2,/Users/gabriel/.rvm/ruby-1.8.7-p174/include,/Users/gabriel/.rvm/ruby-1.8.7-p174/include/libxml2,/usr/include,/usr/include/libxml2... -------------------- yes
"gcc -E -I. -I/Users/gabriel/.rvm/ruby-1.8.7-p174/lib/ruby/1.8/i686-darwin9.8.0 -I. -I/opt/local/include/ -I/opt/local/include/libxml2 -I/opt/local/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -isysroot /Developer/SDKs/MacOSX10.5.sdk -arch x86_64 -pipe -fno-common -g -DXP_UNIX -O3 -Wall -Wcast-qual -Wwrite-strings -Wconversion -Wmissing-noreturn -Winline -I/opt/local/include/ conftest.c -o conftest.i"
checked program was:
/* begin */
1: #include <iconv.h>
/* end */
--------------------
Target: i686-apple-darwin9
Configured with: /var/tmp/gcc/gcc-5490~1/src/configure --disable-checking -enable-werror --prefix=/usr --mandir=/share/man --enable-languages=c,objc,c++,obj-c++ --program-transform-name=/^[cg][^.-]*$/s/$/-4.0/ --with-gxx-include-dir=/include/c++/4.0.0 --with-slibdir=/usr/lib --build=i686-apple-darwin9 --with-arch=apple --with-tune=generic --host=i686-apple-darwin9 --target=i686-apple-darwin9
Thread model: posix
gcc version 4.0.1 (Apple Inc. build 5490)
export CLICOLOR=1
export LSCOLORS=ExFxCxDxBxegedabagacad
export LC_CTYPE=en_US.UTF-8 # for textmate svn bundle repo
# A "safer" rm; moves file to Trash instead
function trash() {
target="$HOME/.Trash/"
filepath=$(eval echo \$${#}) # trying to get last argument; don't know how to do so without using eval
file=$(basename "$filepath")
- link_to sn[:url] % article_url(@article) do
image_tag sn[:image], :alt => sn[:name], :title => sn[:title]
{ scopeName = 'text.haml';
fileTypes = ( 'haml', 'sass' );
foldingStartMarker = '^\s*([-%#\:\.\w\=].*)\s$';
foldingStopMarker = '^\s*$';
patterns = (
{ contentName = 'string.quoted.double.ruby';
begin = '^\s*==';
end = '$\n?';
patterns = ( { include = '#interpolated_ruby'; } );
},
# Newbie Programmer
def factorial(x)
if x == 0
return 1
else
return x * factorial(x - 1)
end
end
puts factorial(6)
puts factorial(0)
load_and_authorize_resource :foo, :find_by => :name, :only => :show
load_and_authorize_resource :foo, :find_by => :id, :except => :show
#container
+container
#content
+column(18)
#sidebar
+column(4,true)
+push(2)
@gabrielmansour
gabrielmansour / wp_migrate.sql
Created December 20, 2010 18:47
Wordpress Domain Migration script
SET @old='http://old.example.com', @new='http://new.example.com';
UPDATE wp_options SET option_value = replace(option_value, @old, @new) WHERE option_name = 'home' OR option_name = 'siteurl';
UPDATE wp_posts SET guid = replace(guid, @old, @new);
UPDATE wp_posts SET post_content = replace(post_content, @old, @new);
UPDATE wp_posts SET post_excerpt = replace(post_excerpt, @old, @new);