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
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
#! /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 _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
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
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
class VeryBase | |
def self.attr_accessor(*vars) | |
@attributes ||= [] | |
@attributes.concat vars | |
super(*vars) | |
end | |
def self.attributes | |
@attributes || [] | |
end |
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
declare -x LANG="ru_RU.UTF-8" | |
SSH_AGENT_PID=`ps x| grep ssh-agent | grep -v grep | awk '{print $1}'`; | |
if [ -n "$SSH_AGENT_PID" ]; then | |
export SSH_AGENT_PID; | |
SSH_AUTH_SOCK=/tmp/`ls --co=never /tmp | grep ssh`; | |
SSH_AUTH_SOCK=$SSH_AUTH_SOCK/`ls --co=never $SSH_AUTH_SOCK`; | |
export SSH_AUTH_SOCK; | |
else | |
eval `ssh-agent`; |
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 'barracuda' | |
require 'RMagick' | |
include Magick | |
include Barracuda | |
prog = Program.new <<-'eof' |
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
// Include required modules. | |
var net = require('net'); | |
var sys = require('sys'); | |
// Create a TCP server and listen on FastAGI port. | |
var server = net.createServer(); | |
server.listen(4573, '127.0.0.7'); | |
// Add a listener for new connections. | |
server.addListener('connection', fastAGI); |