Skip to content

Instantly share code, notes, and snippets.

View guilleiguaran's full-sized avatar
💭

Guillermo Iguaran guilleiguaran

💭
View GitHub Profile
#header {
position:relative;
width:960px;
padding-bottom:25px;
}
#header p{
text-transform:uppercase;
}
module AuthlogicModel
def self.included(model)
model.class_eval do
extend ClassMethods
include InstanceMethods
include ProtectedAttributes
field :username
field :email
field :crypted_password
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="Author" content="Dream Deals Inc" />
<meta name="Descripction" content="A Website store" />
<meta name="Keywords" content="shop, store" />
<meta name="Robots" content="index,follow" />
<link href="estilo.css" rel="stylesheet" type="text/css" media="screen" />
<title>Dream Deals</title>
<?php // Manual de PHP de WebEstilo.com
if(isset($_POST['agregar'])){
session_start();
session_register('itemsEnCesta');
$item=$_GET['id'];
$cantidad=$_POST['cant'];
$itemsEnCesta=$_SESSION['itemsEnCesta'];
if ($item){
if (!isset($itemsEnCesta)){
for (var i=0; i < 100000; i++) {
db.mass_insert.save({
"first_name": "James",
"middle_name": "Richard",
"last_name": "Windsgate",
"email": "[email protected]"
});
};
def tip(msg); puts; puts msg; puts "-"*100; end
#
# 30 Ruby 1.9 Tips, Tricks & Features:
# http://www.igvita.com/2011/02/03/new-ruby-19-features-tips-tricks/
#
tip "Upgrading to Ruby 1.9 is simple: rvm install 1.9.2 && rvm --default 1.9.2"
tip "Ruby 1.9 supports named captures in regular expressions!"
@guilleiguaran
guilleiguaran / custom_compiler.rb
Created September 29, 2011 05:08 — forked from nhocki/assets.rake
Compile assets and push them automatically when run rake assets:precompile
class AssetsCompiler < Sprockets::StaticCompiler
def precompile(paths)
ensure_clean_git
Rake::Task["assets:clean"].invoke
super
commit_compiled_assets
push
end
def ensure_clean_git
@guilleiguaran
guilleiguaran / gist:2048817
Created March 16, 2012 06:48 — forked from rywall/gist:2039089
Identity Map Bug Fix
gem 'rails', :git => 'git://github.com/rails/rails.git', :ref => 'c1f397f82c7b3f352500832a399b5dbdc500b9c8'# change as required
require 'active_record'
require 'logger'
# Show ActiveRecord log output
ActiveRecord::Base.logger = Logger.new(STDOUT)
# Print out what version we're running
puts "Active Record #{ActiveRecord::VERSION::STRING}"
@guilleiguaran
guilleiguaran / elements.md
Created April 27, 2012 17:12 — forked from soveran/elements.md
Excerpts from The Elements of Programming Style. The source of this compilation is unknown.

The Elements of Programming Style

The following rules of programming style are excerpted from the book "The Elements of Programming Style" by Kernighan and Plauger, published by McGraw Hill. Here is quote from the book: "To paraphrase an observation in The Elements of Style by Strunk and White, the rules of programming style, like those of English, are sometimes broken, even by the best writers. When a rule is broken, however, you will usually find in the program some compensating merit, attained at the cost of the violation. Unless you are certain of doing as well, you will probably do best to follow the rules."

@guilleiguaran
guilleiguaran / chat.rb
Created May 3, 2012 03:11 — forked from rkh/chat.rb
Simple Chat Application using the Sinatra Streaming API
# coding: utf-8
require 'sinatra'
set server: 'thin', connections: []
get '/' do
halt erb(:login) unless params[:user]
erb :chat, locals: { user: params[:user].gsub(/\W/, '') }
end
get '/stream', provides: 'text/event-stream' do