This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Cliente REST para poder consumir el servicio WEB de MotoEx | |
* @author: Boris Barroso | |
* @license: GNU/GPL | |
*/ | |
class RestMotoEx { | |
public $url, $format; | |
/** |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Cliente REST para poder consumir el servicio WEB de MotoEx | |
* @author: Boris Barroso | |
* @license: GNU/GPL | |
*/ | |
class RestMotoEx { | |
public $url, $format; | |
/** |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
rails test_simple_form | |
# The I edit the Gemfile to use simple_form | |
Gem "simple_form" | |
rails g simple_form_install | |
rails g scaffold user name:string | |
rails g scaffold post title:string post:text user:references |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require "rubygems" | |
require "gcal4ruby" | |
class Time | |
def self.parse_complete(value) | |
if value =~ /^[0-9]+T[0-9]+$/ | |
d, h = value.split("T") | |
Time.parse(d+" "+h.gsub("Z", "")) | |
else | |
Time.parse(value + " 00:00:00") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/perl -w | |
# mysqltuner.pl - Version 1.1.0 | |
# High Performance MySQL Tuning Script | |
# Copyright (C) 2006-2009 Major Hayden - [email protected] | |
# | |
# For the latest updates, please visit http://mysqltuner.com/ | |
# Subversion repository available at http://tools.assembla.com/svn/mysqltuner/ | |
# | |
# This program is free software: you can redistribute it and/or modify | |
# it under the terms of the GNU General Public License as published by |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo apt-get install curl git-core ruby | |
bash < <( curl http://rvm.beginrescueend.com/releases/rvm-install-head ) | |
echo "[[ -s "$HOME/.rvm/scripts/rvm" ]] && source \"$HOME/.rvm/scripts/rvm\"" >> .bashrc | |
sudo aptitude install build-essential bison openssl libreadline5 libreadline-dev curl git-core zlib1g zlib1g-dev libssl-dev vim-gnome libsqlite3-0 libsqlite3-dev sqlite3 libreadline-dev libxml2-dev git-core subversion autoconf | |
rvm install 1.9.2 | |
cd ~/.rvm/src/ruby-1.9.2-p0/ext/readline | |
ruby extconf.rb | |
make | |
make install |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Prueba | |
attr_reader :nombre, :apellido, :edad | |
def initialize(&b) | |
instance_eval &b | |
end | |
def method_missing(method, param) | |
method = method.to_s | |
if prueba_methods.include?(method) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
-- phpMyAdmin SQL Dump | |
-- version 3.3.8 | |
-- http://www.phpmyadmin.net | |
-- | |
-- Host: localhost | |
-- Generation Time: Dec 13, 2010 at 10:02 AM | |
-- Server version: 5.1.41 | |
-- PHP Version: 5.3.2-1ubuntu4.5 | |
SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
source :rubygems | |
gem "rails", ">= 3.0" | |
gem "rack" | |
gem "clearance", "0.9.0.rc9" | |
gem "haml" | |
gem "high_voltage" | |
gem "hoptoad_notifier" | |
gem "RedCloth", :require => "redcloth" | |
gem "paperclip" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Some examples to not forget Ruby metaprogramming | |
class Uno | |
end | |
module ExtendMethods | |
def self.included(base) | |
base.send(:include, ClassMethods) | |
base.send(:extend, InstanceMethods) | |
end |
OlderNewer