Skip to content

Instantly share code, notes, and snippets.

View bullfight's full-sized avatar
🚀

Patrick Schmitz bullfight

🚀
View GitHub Profile
@bullfight
bullfight / gist:1031181
Created June 17, 2011 10:27
@each multiple lists?
$nav_elements: home, bio, shows, music, video, photos, store;
$nav_element_positions: 86px, 55px, 62px, 82px, 88px, 103px, 94px;
@each $element,$position in $nav_elements,$nav_element_positions {
ul li.nav_#{$element} a {
width: $position; }
}
@bullfight
bullfight / style.css
Created June 17, 2011 11:32
Menu CSS to SCSS
/* =Menu
-------------------------------------------------------------- */
div.menu { width: 570px; height: 72px; float: left; margin: 0 auto; padding: 22px 0 0 0; }
div.menu ul { width: 570px; height: 33px; margin: 0; padding: 0; float: left; background: url("images/mainnav.gif") no-repeat top left; }
div.menu ul li { list-style-type: none; float: left; margin: 0; padding: 0; display: inline; height: 33px; }
div.menu ul li a { display: block; height: 33px; text-indent: -9999px; outline: none; margin: 0; }
div.menu ul li.nav_home a { width: 86px; }
div.menu ul li.nav_bio a { width: 55px; }
div.menu ul li.nav_shows a { width: 62px; }
/* =Menu
-------------------------------------------------------------- */
div.menu { width: 570px; height: 72px; float: left; margin: 0 auto; padding: 22px 0 0 0; }
div.menu ul { width: 570px; height: 33px; margin: 0; padding: 0; float: left; background: url("images/mainnav.gif") no-repeat top left; }
div.menu ul li { list-style-type: none; float: left; margin: 0; padding: 0; display: inline; height: 33px; }
div.menu ul li a { display: block; height: 33px; text-indent: -9999px; outline: none; margin: 0; }
div.menu ul li.nav_home a { width: 86px; }
div.menu ul li.nav_bio a { width: 55px; }
div.menu ul li.nav_shows a { width: 62px; }
= render :partial => 'shared/feed_item', :collection => @feed_items
.pagination
= link_to_next_page @feed_items, "More", :remote => true
@bullfight
bullfight / app.css
Created June 25, 2011 14:04
example of compass based layout
@mixin base-style{
@include border-radius(3px);
@include background-image(linear-gradient(top, #eee, #dddddd));
border: 1px solid #ccc;
@include prepend-top(20px);
@include clearfix;
hr{
@include colruler(#fff);
margin:0px;
@bullfight
bullfight / fakeout.rake
Created June 28, 2011 11:09 — forked from matthutchinson/fakeout.rake
fakeout.rake - a simple/configurable rake task that generates some random fake data for the app (using faker) at various sizes
# a simple/configurable rake task that generates some random fake data for the app (using faker) at various sizes
# NOTE: requires the faker or ffaker gem
# sudo gem install faker - http://faker.rubyforge.org
# OR
# sudo gem install ffaker - http://github.com/EmmanuelOga/ffaker
require 'faker'
class Fakeout
@bullfight
bullfight / reddit_rvm.md
Created August 21, 2011 08:27
setup rvm

Start by installing RVM

  1. go to the command line and your home directory
cd ~/
  1. Type the following to install RVM
// This is my handler in the javascript
var uploadCompleteHandler = function(upload_options,event){
$.ajax({
url: '<%= notify_rails_of_successful_upload_path(:format => :js)%>',
global: false,
type: 'POST',
data: ({
'authenticity_token' : '<%= form_authenticity_token %>',
'upload' : {
'file_file_name' : upload_options.FileName,
<script type="text/javascript">
var queueBytesLoaded = 0;
var queueBytesTotal = 0;
var myQueue = null;
var queueChangeHandler = function(queue){
// alert('Uploading Started');
myQueue = queue;
// console.log("COLLECTION CHANGE!");
var list = document.getElementById('file_todo_list');
@bullfight
bullfight / factories.rb
Created September 13, 2011 13:14 — forked from cblunt/factories.rb
Simulate paperclip attachments with FactoryGirl in Rails 3
Factory.define :application do |factory|
factory.attachment :sample, "public/samples/sample.doc", "application/msword"
end