Skip to content

Instantly share code, notes, and snippets.

@iosadchiy
iosadchiy / a1_test.go
Last active June 21, 2018 08:57
TV A1
package tv_a1
import (
"fmt"
"testing"
)
type Vcpu struct {
}
# /usr/local/nginx/conf/rails-vhosts/kdcuk.co.uk.conf
server {
listen 212.110.170.198:80;
server_name kdcuk.co.uk;
root /home/kdcuk/domains/kdcuk.co.uk/current/public; # <--- be sure to point to 'public'!
passenger_enabled on;
rack_env production;
}
require 'spec_helper'
describe ApplicationController do
controller(ApplicationController) do
def index
render :nothing => true
end
end
it "loads categories for side menu" do
class ApplicationController < ActionController::Base
include InheritedResources::DSL
protect_from_forgery
before_filter :categories_for_menu
private
def categories_for_menu
@root_category, @menu_categories = Category.arrange.first
rand_id = rand(Product.count)
rand_record = Product.first(:conditions => [ "id >= ?", rand_id])
require 'omniauth/openid'
require 'openid/store/filesystem'
Rails.application.config.middleware.use OmniAuth::Builder do
provider :twitter, '7v0ECcPvUHZtkqM8tiWpug', 'W874PN5kksX8or5fzWs77pKQfY51EY7qyPkaCeXbo'
end
+ def destroy
+ url = edit_admin_kitchen_path(params[:kitchen_id])
+ destroy! { url }
+ end
module ApplicationHelper
def current_category
@category || @kitchen && @kitchen.category || Category.roots.first
end
end
[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" # This loads RVM into a shell session.
[[ -s ".rvmrc" ]] && source .rvmrc # cope the terminator's window splitting problem