Skip to content

Instantly share code, notes, and snippets.

FacebookException::SessionError in WelcomeController#index
FacebookException::SessionError
Rails.root: /Users/apple/Works/ntu_scheduler
Application Trace | Framework Trace | Full Trace
app/controllers/application_controller.rb:31:in `rescue in validate_session'
app/controllers/application_controller.rb:28:in `validate_session'
app/controllers/welcome_controller.rb:21:in `validate_facebook'
NameError in Main#index
Showing /Users/apple/Works/ntu_scheduler/app/views/schedules/_show.html.haml where line #3 raised:
undefined local variable or method `schedule' for #<#<Class:0x007fbbce027ee8>:0x007fbbce023ca8>
Extracted source (around line #3):
1: - lesson_names = Array.new(6) do |d|
2: - one_day = Array.new(15, "")
3: - schedule.days[d].lessons.each { |l| one_day[l.time] = l.name }
p/views/shared/_user_info.html.haml:6: syntax error, unexpected ']', expecting ')'
...作業",2], ["Create New Set",0]], {:include_blank => false, :...
... ^
/Users/apple/Works/ntu_scheduler/app/views/shared/_user_info.html.haml:6: syntax error, unexpected ',', expecting ')'
...Select a schedule set to add'}, {:id => 'add_to_set_select'}
... ^
Function body: def _app_views_shared__user_info_html_haml___3099868642334714315_70328624406960(local_assigns, output_buffer)
_old_virtual_path, @virtual_path = @virtual_path, "shared/_user_info";_old_output_buffer = @output_buffer;user = local_assigns[:user];user_info = local_assigns[:user_info];;begin;extend Haml::Helpers;_hamlout = @haml_buffer = Haml::Buffer.new(@haml_buffer, {:autoclose=>["meta", "img", "link", "br", "hr", "input", "area", "param", "col", "base"], :preserve=>["textarea", "pre", "code"], :attr_wrapper=>"'", :ugly=>false, :format=>:html5, :encoding=>"UTF-8", :escape_html=>
.user_info.span16
-#.span3
-# = image_tag "http://graph.facebook.com/#{user.facebook_uid}/picture?type=small"
%h2 #{user.name}'s Schedule
.fun
= select "set", "name", ["社團朋友",1], ["國文作業",2], ["Create New Set",0]]-#, {:include_blank => false, :prompt => 'Select a schedule set to add'}, {:id => 'add_to_set_select'}
-#s= link_to "Add", "#", :class => "btn success small"
@zetachang
zetachang / Gemfile
Created November 29, 2011 06:09 — forked from chriseppstein/readme.md
How to integrate Compass with Rails 3.1 asset pipeline
group :assets do
gem 'sass-rails', '~> 3.1.0'
gem 'coffee-rails', '~> 3.1.0'
gem 'uglifier'
gem 'compass', '~> 0.12.alpha'
# include other compass plugins here. E.g.:
gem 'compass-susy-plugin', :require => 'susy'
end
@import "compass"
@import "preboot"
@import "compass-bootstrap/compass_bootstrap"
@mixin center
margin-left: auto
margin-right: auto
body
//background: image_url('background3.jpg')
background: #dcdcdc
#topbar
<!DOCTYPE html>
%html
%head
%meta{:charset=>"utf-8"}
<!-- Always force latest IE rendering engine (even in intranet) & Chrome Frame -->
%meta{:content=>"IE=edge,chrome=1", :"http-equiv"=>"X-UA-Compatible"}
= stylesheet_link_tag "site"
= javascript_include_tag "https://www.google.com/jsapi"
= javascript_include_tag "application"
%meta{:property=>"og:title",:content=>"針對新聞說出你的看法--台灣投票 Taiwan Voting"}
#include <stdio.h>
#include <stdlib.h>
void three_n_plus_one(int n,int *count,int a[]);
int main(void)
{
int count=0,input[3],a[100],i,j;
printf("請輸入三個值:");
scanf("%d %d %d",&input[0],&input[1],&input[2]);
for(i=0;i<3;i++)
@zetachang
zetachang / gist:4105844
Created November 18, 2012 15:35
Textmate grammer
bracketed_content = {
name = 'meta.bracketed.objc';
begin = '\[';
end = '\]';
beginCaptures = { 0 = { name = 'punctuation.section.scope.begin.objc'; }; };
endCaptures = { 0 = { name = 'punctuation.section.scope.end.objc'; }; };
patterns = (
{ name = 'meta.function-call.predicate.objc';
begin = '(?=predicateWithFormat:)(?<=NSPredicate )(predicateWithFormat:)';
end = '(?=\])';
@zetachang
zetachang / gist:4111314
Created November 19, 2012 15:37
Instruction on adding a Acknowledgements Settings.bundle
  • To add Settings.bundle in Xcode. Command N and in Resource, choose Settings Bundle .
  • Open Root.plist in source code, paste the code below to replace it,
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
	<key>PreferenceSpecifiers</key>