Skip to content

Instantly share code, notes, and snippets.

View tammersaleh's full-sized avatar

Tammer Saleh tammersaleh

  • Ditto.com
  • California, USA
  • 22:10 (UTC -07:00)
View GitHub Profile
[tsaleh@tardis:~/code/liveworld-seattle multitenant ∴ ] ./clear_cache.sh
* About to connect() to localhost port 8080 (#0)
* Trying ::1... Connection refused
* Trying fe80::1... Connection refused
* Trying 127.0.0.1... connected
* Connected to localhost (127.0.0.1) port 8080 (#0)
> POST /admin/system-cache.jsp HTTP/1.1
> User-Agent: curl/7.16.3 (powerpc-apple-darwin9.0) libcurl/7.16.3 OpenSSL/0.9.7l zlib/1.2.3
> Host: localhost:8080
> Accept: */*
mysql> show tables;
+---------------------------------------+
| Tables_in_everett_multitenant_default |
+---------------------------------------+
| abuseMessage |
| abuseMessageProp |
| abuseThread |
| abuseThreadProp |
| clubInvitation |
| deletedCategory |
[tsaleh@tardis:~/code/liveworld-seattle multitenant ∴ ] cat WEB-INF/jiveHome/jive_startup.xml
<defaultProvider>
<username>jive</username>
<serverURL>jdbc:mysql://localhost:3306/everett_multitenant_default</serverURL>
<maxConnections>25</maxConnections>
<connectionTimeout>1.0</connectionTimeout>
<driver>com.mysql.jdbc.Driver</driver>
<password>JumpnJ1v3</password>
<minConnections>5</minConnections>
</defaultProvider>
Account Create (0.3ms) INSERT INTO `accounts` (`name`, `updated_at`, `deleted_at`, `pending_deletion`, `full_domain`, `created_at`, `tenant_disabled`) VALUES('Cakes Account', '2009-05-26 11:13:25', NULL, 0, 'cakes.livebarhq.com', '2009-05-26 11:13:25', 0)
POST http://localhost:8080/services/seattle/tenants.json
---
- "{\"username\": \"cakes\", \"domain\": \"cakes.livebarhq.com\", \"first_name\": \"Cakes\", \"password\": \"test\", \"last_name\": \"Admin\", \"email\": \"[email protected]\"}"
- Authentication: f5d06ddb28537e81edcaa1a1f1ca842cba77d6219bba95fbb38a4906750c7d5d0e6301a6c602a918
Content-Type: application/json
--> 201 Created ({"admin_token_value":"c0b701fe7381e1b31a56f130a162bd8b2280d0b985d11ed9fc86507eeb70f6aa83ec45fd9f87c693","anon_token_value":"681e35bcbd3a74a7a34317d98036daa7fdc5840db09c81cb6c325519df0077c5","domain":"cakes.livebarhq.com","email":null,"first_name":null,"id":3,"last_name":null,"password":null,"username":null}b 1.38s)
User Exists (0.5ms) SELECT `users`.id FROM `users` WHE
def email_validate_confirmation_required?
(self.email.blank? && !self.email_confirmation.blank?) ||
(!self.email.blank? && !self.email_confirmation.blank?) ||
(!self.email.blank? && self.email_confirmation.blank?)
end
def fb_cookie_prefix
Facebooker.api_key+"_"
end
def fb_cookie_names
fb_cookie_names = cookies.keys.select{|k| k.starts_with?(fb_cookie_prefix)}
end
def secure_with_cookies!
parsed = {}
def post_form_with_net_http(url,params)
Net::HTTP.post_form(url, params)
end
def post_form_with_curl(url,params,multipart=false)
response = Curl::Easy.http_post(url.to_s, *to_curb_params(params)) do |c|
c.multipart_form_post = multipart
c.timeout = Facebooker.timeout
end
response.body_str
def publish(feed_story_or_action)
session.post(Facebooker::Feed::METHODS[feed_story_or_action.class.name.split(/::/).last], feed_story_or_action.to_params) == "1" ? true : false
end
{:one => 1, :two => 2}.select {|k,v| k == :one} #=> [[:one, 1]]
def cookies
return {} unless @env["HTTP_COOKIE"]
if @env["rack.request.cookie_string"] == @env["HTTP_COOKIE"]
@env["rack.request.cookie_hash"]
else
@env["rack.request.cookie_string"] = @env["HTTP_COOKIE"]
# According to RFC 2109:
# If multiple cookies satisfy the criteria above, they are ordered in
# the Cookie header such that those with more specific Path attributes