Skip to content

Instantly share code, notes, and snippets.

View denysonique's full-sized avatar

Dennis Prochniak denysonique

View GitHub Profile
#include <QtNetwork>
#include <QtGui>
#include "server.h"
#include <QObject>
#include <QMessageBox>
Server::Server(QMainWindow *window)
{
tcpServer = new QTcpServer();
require 'Qt4'
require 'qtwebkit'
app = Qt::Application.new(ARGV)
web_view = Qt::WebView.new
web_view.load(Qt::Url.new('http://nightly.webkit.org'))
web_view.show()
web_view.page.linkDelegationPolicy = 2
web_view.connect(SIGNAL "linkClicked(const QUrl)") { |url|
#Pajton:
import threading
from time import sleep
class watek(threading.Thread):
def __init__(self):
while(not sleep(3)):
print 'foobar'
watek()
$ ruby client.rb
/home/dennis/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/thread.rb:185:in `sleep': deadlock detected (fatal)
from /home/dennis/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/thread.rb:185:in `block in pop'
from <internal:prelude>:10:in `synchronize'
from /home/dennis/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/1.9.1/thread.rb:180:in `pop'
from /home/dennis/.rvm/gems/ruby-1.9.2-p180/gems/emdrb-0.4.4/lib/emdrb/emdrb.rb:894:in `method_missing'
from client.rb:52:in `block in initialize_ui'
from /home/dennis/.rvm/gems/ruby-1.9.2-p180/gems/qtbindings-4.6.3.2/lib/Qt/qtruby4.rb:2427:in `call'
from /home/dennis/.rvm/gems/ruby-1.9.2-p180/gems/qtbindings-4.6.3.2/lib/Qt/qtruby4.rb:2427:in `invoke'
from client.rb:73:in `qt_metacall'
require 'eventmachine'
require 'Qt4'
require 'emdrb'
require './client_ui'
$time_remaining ||= Time.new(0,1,1,1)
$time_used ||= Time.new(0)
class ClientController
def initialize
Failures:
1) Signed in user should sign in successfully
Failure/Error: current_path.should eq('/profile')
expected "/profile"
got "/users/sign_in"
(compared using ==)
# ./spec/requests/user_home_spec.rb:18:in `block (2 levels) in <top (required)>'
require 'spec_helper'
describe 'Signed in' do
before(:each) do
user = Factory(:user)
visit new_user_session_path
fill_in 'Email', with: user.email
fill_in 'Password', with: user.password
click_button 'Sign in'
filename=$(basename $0)
APP=${filename#thin-}
CONFIG="/etc/thin/$APP.yml"
ARGS="--daemonize --config=/etc/thin/$APP.yml"
RVM_ENV="ruby-1.8.7-p352@redmine"
source "/usr/local/rvm/environments/$RVM_ENV"
COMMAND="sudo -Eu $APP $(which thin)"
case "$1" in
start)
require 'spec_helper'
describe ProfileController do
include Devise::TestHelpers
before(:each) do
@user = Factory.create(:user)
sign_in @user
end
@denysonique
denysonique / gist:1099325
Created July 22, 2011 12:10 — forked from nickws/gist:1099324
database.yml
development:
adapter: postgresql
database: emotio-dev
pool: 5
timeout: 5000
# Warning: The database defined as "test" will be erased and
# re-generated from your development database when you run "rake".
# Do not set this db to the same as development or production.
test: