This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$(function() { | |
window.fbAsyncInit = function() { | |
FB.init({appId: '132068066870042', status: true, cookie: true, | |
xfbml: true}); //dev | |
//FB.init({appId: '187884157925798', status: true, cookie: true, | |
// xfbml: true}); //prod | |
FB.getLoginStatus(function(response) { | |
if (response.session) { | |
// logged in and connected user, someone you know |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div id="fb-root"></div> | |
<%= javascript_include_tag 'fbconnect' %> | |
Auto-post on Facebook | |
<span id="fbusing" style="display:none;">using account | |
<span id="fbuser"> | |
<a href="" onclick="window.open('http://www.facebook.com/settings/?tab=privacy','_blank');return false;" ><%= @user.fbusername%></a> | |
</span> | |
</span> | |
<span id ="connectwithfb"> | |
<a href="" id="fbconnect"><%= image_tag("facebook-connect-button.png",:border=>0,:height=>18,:width=>120)%></a> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class AddFbAccessTokenToUsers < ActiveRecord::Migration | |
def self.up | |
add_column :users, :fbaccess, :string | |
add_column :users, :fbusername, :string | |
add_column :users, :fb_uid, :bigint | |
end | |
def self.down | |
remove_column :users, :fbaccess | |
remove_column :users, :fbusername |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# config/initializers/koala.rb | |
module Facebook | |
CONFIG = YAML.load_file(Rails.root + "config/facebook.yml")[Rails.env] | |
APP_ID = CONFIG['app_id'] | |
SECRET = CONFIG['secret_key'] | |
CALLBACK_URL = CONFIG['callback_url'] | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#config/facebook.yml | |
development: | |
app_id: 1158718570175 | |
secret_key: aashfljkhaklasfasfd | |
app_key: sdgasdg435672456236 | |
callback_url: http://localhost:3000/ | |
test: | |
app_id: 1158718570175 | |
secret_key: aashfljkhaklasfasfd |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
has_attached_file :user_pic, :styles => { | |
:thumb=>"50x50#" | |
}, | |
:default_url => "/images/missing.png" | |
validates_attachment_size :user_pic, :less_than => 10.megabytes | |
validates_attachment_content_type :user_pic, :content_type => ['image/jpeg','image/jpg','image/png','image/gif','image/pjpeg'] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cmd = "#{SCRIPTS_HOME}/bin/run_load.sh #{SCRIPTS_CONFIG} #{@file.file_upload.path}"; | |
logger.info cmd; | |
Open3.popen3(cmd) do |i, o , e| | |
logger.info "CMD STDOUT " << o.read | |
logger.info "CMD STDERR " << e.read | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CREATE OR REPLACE FUNCTION getDelimRow(p_slct character varying, p_dlmtr character varying DEFAULT ','::character varying) | |
RETURNS character varying AS | |
$BODY$ | |
DECLARE | |
cur1 refcursor; | |
lc_str VARCHAR(4000); | |
lc_colval VARCHAR(4000); | |
intervalNum INTEGER; | |
BEGIN |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
root@joe-ubuntu-0930:/home# apt-get install ruby irb rdoc | |
Reading package lists... Done | |
Building dependency tree | |
Reading state information... Done | |
The following extra packages will be installed: | |
irb1.8 libreadline-ruby1.8 libreadline5 libruby1.8 rdoc1.8 ruby1.8 | |
Suggested packages: | |
graphviz ruby1.8-examples ri1.8 | |
The following NEW packages will be installed: | |
irb irb1.8 libreadline-ruby1.8 libreadline5 libruby1.8 rdoc rdoc1.8 ruby ruby1.8 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apt-get update |