This file contains hidden or 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 Item < ActiveRecord::Base | |
serialize :attrs | |
def method_missing(name, *args) | |
super | |
rescue NoMethodError | |
self.attrs = {} if self.attrs.nil? | |
if args.empty? | |
self.attrs[name.to_s] | |
else |
This file contains hidden or 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
module ActsAsAdmin | |
def self.included(base) | |
base.extend ClassMethods | |
end | |
module ClassMethods | |
def acts_as_admin | |
layout lambda{ |c| | |
if c.request.xhr? | |
nil |
This file contains hidden or 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
var _ImagePreview = function() { | |
this.image = null; | |
this.image_object = new Image(); | |
this.image_view = function(el,dest) | |
{ | |
var imagefile = document.getElementById(el); | |
this.image = document.getElementById(dest); | |
// HTML5 FileAPI: Firefox 3.6+, Chrome 6+ | |
if(typeof(FileReader)!='undefined') | |
{ |
This file contains hidden or 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
#! /bin/sh | |
### BEGIN INIT INFO | |
# Provides: cargoboss-node | |
# Required-Start: $syslog $remote_fs | |
# Required-Stop: $syslog $remote_fs | |
# Should-Start: $local_fs | |
# Should-Stop: $local_fs | |
# Default-Start: 2 3 4 5 | |
# Default-Stop: 0 1 6 |
This file contains hidden or 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
var sys = require('sys'); | |
var redis = require('./lib/redis-client'); | |
var ws = require('./lib/ws'); | |
var clients = []; | |
var pubsub = redis.createClient(); | |
pubsub.stream.addListener('connect', function(){ | |
sys.debug('Connected to queue'); | |
pubsub.subscribeTo("cargoboss:auction:*:bids", function(channel, data){ | |
var auction_id = channel.toString().split(':')[2]; |
This file contains hidden or 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
require 'rubygems' | |
require 'mp3info' | |
require 'logger' | |
require 'gdata' | |
#ARGV[0] - directory | |
#cover.jpg - cover | |
#description.txt - description for tracks | |
#tags.txt - tags |
This file contains hidden or 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
// Custom transition for Scriptaculous | |
Effect.Transitions.easeInBack = function(pos) { | |
var x = 1.618; | |
return Math.pow(pos, 2) * ((x + 1) * pos - x); | |
}; | |
var WebcallPlugin = { | |
actionInProcess : false, | |
validateResult : false, | |
interval : null, |
This file contains hidden or 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
// Custom transition for Scriptaculous | |
Effect.Transitions.easeInBack = function(pos) { | |
var x = 1.618; | |
return Math.pow(pos, 2) * ((x + 1) * pos - x); | |
}; | |
var WebcallPlugin = { | |
actionInProcess : false, | |
validateResult : false, | |
interval : null, |
This file contains hidden or 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
<script> | |
document.observe('dom:loaded', function() { | |
WebcallPlugin.initialize({ | |
actionButton : $$('#webcall-wrapper a.form-submit')[0], | |
frameContainer : $$('#webcall-wrapper ul')[0], | |
frameWidth : $$('#webcall-wrapper ul li')[0].getWidth(), | |
haveMoney : <%=@current_user.webcall_allowed?%>, | |
captions : { | |
phone : 'phone number', | |
sip : 'SIP Address', |
This file contains hidden or 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
// Custom transition for Scriptaculous | |
Effect.Transitions.easeInBack = function(pos) { | |
var x = 1.618; | |
return Math.pow(pos, 2) * ((x + 1) * pos - x); | |
}; | |
var WebcallPlugin = { | |
actionInProcess : false, | |
validateResult : false, |