Skip to content

Instantly share code, notes, and snippets.

View leofrozenyogurt's full-sized avatar

Leo Royzengurt leofrozenyogurt

  • Hipsters and Hamptonites
  • United States
View GitHub Profile
@leofrozenyogurt
leofrozenyogurt / gist:6148029
Created August 3, 2013 21:24
single-event.php
<script>
var AjaxURL = "<?php echo admin_url( 'admin-ajax.php' )?>";
</script>
<?php while ( have_posts() ) : the_post(); ?>
<article id="post-<?php the_ID(); $currentPostId = $post->ID; ?>" <?php post_class( 'event-type' ); ?>>
<header>
@leofrozenyogurt
leofrozenyogurt / gist:6147945
Created August 3, 2013 20:55
Event Admin PHP
<?php
/*
Admin
*/
require_once( ABSPATH . 'wp-admin/includes/taxonomy.php' );
class Morgans_Post_Type_Admin {
url = URI.parse('http://ajax.googleapis.com/ajax/services/search/images?v=1.0&q=fries')
req = Net::HTTP::Get.new('http://ajax.googleapis.com/ajax/services/search/images?v=1.0&q=fries')
res = Net::HTTP.start('ajax.googleapis.com', 80) {|http| http.request(req)}%>
SHOW.JS.ERB
$("#video_div").html("<%= escape_javascript(render(:partial => "client_stories/client_story")) %>");
!-------------!
INDEX.HTML.ERB
<div id='main_profile_column'>
<div id="video_div">
<% @client_stories.each do |client_story| %>
Mailman::Application.run do
default do
u=User.find_by_email(message.from.first)
fn = File.open(message.attachments.first.filename )
Deal.create! title: message.subject, description: message.body.decoded, user_id: u.id ,
dimg1: fn,
category: 'furniture' , price: 12
end
end
Leo-Royzengurts-MacBook-Pro:mmagap leoroyzengurt$ heroku logs --app mmagaptest
2013-04-08T17:07:42+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.12/lib/action_dispatch/routing/route_set.rb:601:in `call'
2013-04-08T17:07:42+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/actionpack-3.2.12/lib/action_dispatch/routing/route_set.rb:32:in `call'
2013-04-08T17:07:42+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/journey-1.0.4/lib/journey/router.rb:68:in `block in call'
2013-04-08T17:07:42+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/journey-1.0.4/lib/journey/router.rb:56:in `call'
2013-04-08T17:07:42+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/omniauth-1.1.4/lib/omniauth/strategy.rb:184:in `call!'
2013-04-08T17:07:42+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/journey-1.0.4/lib/journey/router.rb:56:in `each'
2013-04-08T17:07:42+00:00 app[web.1]: vendor/bundle/ruby/1.9.1/gems/omniauth-1.1.4/lib/omniauth/strategy.rb:164:in `call'
2013-04-08T17:07:42+00:00 app[web.1]: vendo
@leofrozenyogurt
leofrozenyogurt / gist:5314761
Created April 4, 2013 21:57
gemfile and application.rb
Gemfile
source 'https://rubygems.org'
gem 'rails', '3.2.12'
# Bundle edge Rails instead:
# gem 'rails', :git => 'git://github.com/rails/rails.git'
Mmagap::Application.routes.draw do
ActiveAdmin.routes(self)
devise_for :admin_users, ActiveAdmin::Devise.config
post "zencoder-callback" => "zencoder_callback#create", :as => "zencoder_callback"
get 'tags/:tag', to: 'videos#index', as: :tag
devise_for :users, :controllers => { :omniauth_callbacks => "omniauth_callbacks" }
devise_for :users
match '/dashboard' => 'users#dashboard', :as => 'dashboard'
match 'users/:id' => 'users#show'
devise_scope :user do
@leofrozenyogurt
leofrozenyogurt / gist:5308094
Last active December 15, 2015 18:59
comment controller
class CommentsController < ApplicationController
def index
@commentable = Video.find(params[:video_id])
@comments = @commentable.comments
end
def new
@commentable = Video.find(params[:video_id])
@comment = @commentable.comments.new
end
<div class="btn-group span3">
<div class="btn btn-inverse btn-sort">Price</div>
<div class="btn dropdown-toggle btn-inverse" data-toggle="dropdown">
<span class="caret"></span>
</div>
<ul class="dropdown-menu">
<% Listing::PRICECATEGORIES.each do |category| %>
<li>
<label class="checkbox">
<%= check_box_tag 'q[pricecategory_eq_any][]', category %>