Skip to content

Instantly share code, notes, and snippets.

View felipecabargas's full-sized avatar
🇩🇰
Imported from 🇨🇱

A. Felipe Cabargas felipecabargas

🇩🇰
Imported from 🇨🇱
View GitHub Profile
@felipecabargas
felipecabargas / css-order-conventions.css
Created March 17, 2014 20:38
CSS Attributes Order Convention
display: ;
visibility: ;
float: ;
clear: ;
position: ;
top: ;
right: ;
bottom: ;
left: ;
@felipecabargas
felipecabargas / bash.sh
Last active August 29, 2015 13:56
X Mandamientos de GIT
git fetch origin
git checkout your-branch
git push origin your-branch:spike-your-branch
git branch your-branch-backup
git rebase master
rspec
git push origin your-branch --force
git checkout master
git merge your-branch --no-ff
rspec
@felipecabargas
felipecabargas / _bootstrap_item_widget.html.erb
Created February 7, 2014 14:55
Bootstrap an Spree extension
<div class="row widgets">
<div class="col-md-12 col-xs-12">
<% @items.each do |item| %>
<div class="col-md-4 col-xs-4">
<%= image_tag(item.marketing_image) %>
<p><%= item.description %></p>
<p><%= link_to "Ver más", spree.root_path, :class => "cmr-link"%></p>
</div>
<% end %>
</div>
@felipecabargas
felipecabargas / mclovin_controller.rb
Created February 6, 2014 20:33
Simple HTTP Basic Auth snippet for RailsControllers
before_filter :authenticate
protected
def authenticate
authenticate_or_request_with_http_basic do |username, password|
username == "foo" && password == "bar"
end
end
<% content_for :page_title do %>
<%= Spree.t(:listing_featured_items) %>
<% end %>
<% content_for :page_actions do %>
<li>
<%= button_link_to Spree.t(:new_item), new_admin_item_path, :icon => 'icon-plus', :id => 'admin_new_item' %>
</li>
<% end if can? :edit, Spree::Item.new %>
@felipecabargas
felipecabargas / spec_helper.rb
Last active August 29, 2015 13:55
Spree SpecHelper with ControllerRequests, Devise & Paperclip
# Run Coverage report
require 'simplecov'
SimpleCov.start do
add_filter 'spec/dummy'
add_group 'Controllers', 'app/controllers'
add_group 'Helpers', 'app/helpers'
add_group 'Mailers', 'app/mailers'
add_group 'Models', 'app/models'
add_group 'Views', 'app/views'
add_group 'Libraries', 'lib'
@felipecabargas
felipecabargas / PATHS
Created January 28, 2014 21:23
RSpec Looking for spree.admin_items_path (Raise admin_items_path undefined)
app/views/spree/admin/items/index.html.erb
config/routes.rb
spec/views/spree/admin/items/index.html.erb_spec.rb
spec/spec_helper.rb
@felipecabargas
felipecabargas / README.md
Last active December 29, 2015 16:59
LegoMindstorms source code for the homework 1.

Introduccion a la Ingenieria - Prof. Marcelo Mendoza

  • Alfonso Cabargas M. / ROL USM: 201373531-2
  • John Bidwell B. / ROL USM: 201373521-5
@felipecabargas
felipecabargas / test.rb
Created November 27, 2013 00:33
DatabaseImport test
require 'rubygems'
require 'roo'
s = Roo::Excelx.new("../Hacking/Rails/mpnr/data/Ford.xlsx") #Open the spreadsheet
s.default_sheet = s.sheets.first #Select the page to work with
att_col = s.column(1) #First Column (Attributes Hierachy)
#Gives you a count of cols & rows
col_number = s.last_column()
@felipecabargas
felipecabargas / yinyang.css
Created September 15, 2013 21:40
Yin-Yang Pure CSS
#olaquehace {
width: 100px; height: 200px;
background: #fff;
border-color: #000;
border-style: solid;
border-width: 2px 100px 2px 2px;
border-radius: 100%;
position: relative;
}