Skip to content

Instantly share code, notes, and snippets.

View mmcc's full-sized avatar
📺
Movin vidja bits

Matthew McClure mmcc

📺
Movin vidja bits
View GitHub Profile
@mmcc
mmcc / home_controller_decorator.rb
Created November 30, 2011 01:01
home controller
HomeController.class_eval do
def index
@searcher = Spree::Config.searcher_class.new(params)
@products = @searcher.retrieve_products
respond_with(@products)
respond_with do |format|
format.html { render :action => params[:path] }
format.iphone { render :layout => false }
end
@mmcc
mmcc / _products.iphone.erb
Created November 30, 2011 20:36
Products partial
<% if products.any? %>
<ul id="products" title="<%= t(:search_results, :keywords => h(params[:keywords])) %>" selected="true" class="product-listing" data-hook>
<% products.each do |product| %>
<% if Spree::Config[:show_zero_stock_products] || product.has_stock? %>
<li id="product_<%= product.id %>" data-hook="products_list_item">
<%= link_to product.name, product, :class => 'info' %>
<span class="price selling"><%= product_price(product) %></span>
</li>
<% end %>
<% end %>
@mmcc
mmcc / iTermOutput
Created November 30, 2011 21:55
precompile error
/usr/local/lib/ruby/site_ruby/1.8/rubygems/dependency.rb:52:in `initialize': Valid types are [:development, :runtime], not nil (ArgumentError)
from /Library/Ruby/Gems/1.8/gems/bundler-1.0.21/lib/bundler/resolver.rb:352:in `new'
from /Library/Ruby/Gems/1.8/gems/bundler-1.0.21/lib/bundler/resolver.rb:352:in `search'
from /Library/Ruby/Gems/1.8/gems/bundler-1.0.21/lib/bundler/resolver.rb:346:in `gems_size'
from /Library/Ruby/Gems/1.8/gems/bundler-1.0.21/lib/bundler/resolver.rb:179:in `resolve'
from /usr/local/lib/ruby/site_ruby/1.8/rubygems/source_index.rb:95:in `sort_by'
from /Library/Ruby/Gems/1.8/gems/bundler-1.0.21/lib/bundler/resolver.rb:175:in `each'
from /Library/Ruby/Gems/1.8/gems/bundler-1.0.21/lib/bundler/resolver.rb:175:in `sort_by'
from /Library/Ruby/Gems/1.8/gems/bundler-1.0.21/lib/bundler/resolver.rb:175:in `resolve'
from /Library/Ruby/Gems/1.8/gems/bundler-1.0.21/lib/bundler/resolver.rb:160:in `start'
@mmcc
mmcc / menu.js
Created December 27, 2011 21:43
tabpanel
WhyWait.views.Menu = Ext.extend(Ext.TabPanel, {
title: "menu",
iconCls: "note3",
initComponent: function() {
Ext.apply(this, {
defaults: {
styleHtmlContent: true
},
dockedItems: [{
xtype: "toolbar",
@mmcc
mmcc / menu.js
Created December 27, 2011 21:45
tabpanel
WhyWait.views.Menu = Ext.extend(Ext.TabPanel, {
title: "menu",
iconCls: "note3",
initComponent: function() {
Ext.apply(this, {
defaults: {
styleHtmlContent: true
},
dockedItems: [{
xtype: "toolbar",
@mmcc
mmcc / gist.rb
Created June 26, 2012 17:25
destroy.js.erb not hiding
# Controller
respond_to :html, :js
# DELETE /users/1
def destroy
@student = User.find(params[:id])
@student.destroy
respond_with(@student)
rescue
puts $!.inspect, $@
render :nothing => true
@mmcc
mmcc / mixins.scss
Created August 30, 2012 19:05
Common Sass mixins I use.
// Mixins
@mixin hover-ease($element, $time) {
-moz-transition: $element $time + s ease;
-o-transition: $element $time + s ease;
-webkit-transition: $element $time + s ease;
-ms-transition: $element $time + s ease;
}
@mixin corners($radius) {
-webkit-border-radius: $radius;
-moz-border-radius: $radius;
@mmcc
mmcc / layout.haml
Created November 30, 2012 22:17
Starting point for Haml + Sass + Bootstrap + Font Awesome
!!!
%html{ :xmlns => 'http://www.w3.org/1999/xhtml', :lang => 'en', 'xml:lang' => 'en' }
%head
%title Zenquest
%meta{ 'http-equiv' => 'Content-Type', :content => 'text/html; charset=utf-8' }
%link{ :rel => 'stylesheet', :href => '//netdna.bootstrapcdn.com/twitter-bootstrap/2.2.1/css/bootstrap.no-responsive.no-icons.min.css', :type => 'text/css' }
%link{ :rel => 'stylesheet', :href => '//netdna.bootstrapcdn.com/font-awesome/2.0/css/font-awesome.css', :type => 'text/css' }
%link{ :rel => 'stylesheet', :href => '/screen.css', :type => 'text/css' }
%body
@mmcc
mmcc / live_stream.rb
Created January 22, 2013 21:46
Really simple Ruby script to make a basic Live request to Zencoder with a few HLS outputs.
require 'rubygems'
require 'zencoder'
# Change these settings
s3_bucket = ''
Zencoder.api_key = ''
# Quick test to make sure the variables above are set...
if s3_bucket == '' || Zencoder.api_key == ''
puts "It appears you haven't set your S3 bucket or Zencoder API key..."
@mmcc
mmcc / index.html
Last active December 17, 2015 12:29
Video.js example cue plugin for Spree Conf.
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<title></title>
<meta name="description" content="">
<meta name="viewport" content="width=device-width">
<link href="http://vjs.zencdn.net/4.0/video-js.css" rel="stylesheet">