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
require "msgpack" | |
require "socket" | |
class Bar | |
end | |
class Server | |
attr_accessor :server, :exit_now | |
def initialize | |
@server = TCPServer.new("0.0.0.0", 8123) |
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
#include "heapdatamodel.h" | |
namespace RBKit { | |
HeapDataModel::HeapDataModel(HeapItem * _item, QObject *parent) | |
: QAbstractItemModel(parent), rootItem(_item) | |
{ | |
} | |
HeapDataModel::~HeapDataModel() { | |
// delete items; |
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
#include "sortobjectproxymodel.h" | |
SortObjectProxyModel::SortObjectProxyModel(QObject *parent) : | |
QSortFilterProxyModel(parent) | |
{ | |
} | |
bool SortObjectProxyModel::hasChildren(const QModelIndex &parent) const | |
{ | |
const QModelIndex sourceIndex = mapToSource(parent); |
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
(source gnu) | |
(source marmalade) | |
(source melpa) | |
(depends-on "[cl-struct-package-desc git-gutter-fringe (20131117 2335) Fringe version of git-gutter.el [github] ((git-gutter (0 42)) (fringe-helper (0 1 1))) single melpa nil]") | |
(depends-on "[cl-struct-package-desc icicles (20140115 354) Minibuffer input completion and cycling. nil tar melpa nil nil nil]") | |
(depends-on "[cl-struct-package-desc smart-mode-line (20131126 1625) A color coded smart mode-line. ((emacs (24 3)) (dash (2 2 0))) single melpa nil]") | |
(depends-on "[cl-struct-package-desc zenburn-theme (20131119 1158) A low contrast color theme for Emacs. nil single melpa nil]") | |
(depends-on "ac-js2") | |
(depends-on "ace-jump-mode") |
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
def dispatch_action(klass, action, status = 200) | |
controller = klass.new(self, status) | |
- if Dispatcher.use_mutex then | |
+ if nil then | |
@@mutex.synchronize { controller._dispatch(action) } | |
else | |
controller._dispatch(action) | |
end | |
controller | |
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
/home/gnufied/eventfax/examples~ scalac -cp ../target/eventfax-1.0.0.jar:../lib/xlightweb-2.0-beta-2.jar:../lib/xSocket-2.1.1.jar:. ConsumeFormPost.scala | |
ConsumeFormPost.scala:49: error: type mismatch; | |
found : AccountActivity | |
required: org.xlightweb.IHttpResponseHandler | |
val handler: IHttpResponseHandler = new AccountActivity() | |
^ | |
=== code | |
class AccountActivity extends IHttpResponseHandler { | |
def onResponse(response: IHttpResponse) = { | |
val status = response.getStatus() |
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
require 'base64' | |
require 'openssl' | |
module PayNowWidgetUtils | |
def generate_signed_form(access_key, aws_secret_key, form_params) | |
form_params['accessKey'] = access_key | |
# lexicographically sort the form parameters | |
# and create the canonicalized string | |
str_to_sign = "" |
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
require "rubygems" | |
require "net/ssh" | |
module Kernel | |
def with_rsh(host,username,options = {},&block) | |
a = RemoteShell.new(host,username,options) | |
a.start(&block) | |
end | |
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
I am planning to have sites/slice like functionality in my rails app, so as I can roll quick customizations | |
for potential clients (like themes, but more than that). | |
Questions is, for sharing static resources (js,css,images,flash....), I have two options: | |
1. Keep client specific static files in RAILS_ROOT/sites/client_name/public/{javascripts,images,stylesheets} | |
and render them through overridden tag helpers. Down side, is, these static resources won't be then accessible via | |
front end webserver (nginx/apache) and most code I have seen use send_data or something like that to render them. | |
But the up side is each client specific site/slice is self contained. Such as: |
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
~ Connecting to database... | |
/usr/lib/ruby/gems/1.8/gems/merb_activerecord-0.9.4/lib/merb/orms/active_record/connection.rb:79:in `register_session_type': undefined method `register_session_type' for Merb:Module (NoMethodError) | |
from /usr/lib/ruby/gems/1.8/gems/merb_activerecord-0.9.4/lib/merb_activerecord.rb:12:in `run' | |
from /usr/lib/ruby/gems/1.8/gems/merb-core-1.0/lib/merb-core/bootloader.rb:99:in `run' | |
from /usr/lib/ruby/gems/1.8/gems/merb-core-1.0/lib/merb-core/server.rb:172:in `bootup' | |
from /usr/lib/ruby/gems/1.8/gems/merb-core-1.0/lib/merb-core/server.rb:42:in `start' | |
from /usr/lib/ruby/gems/1.8/gems/merb-core-1.0/lib/merb-core.rb:169:in `start' | |
from /usr/lib/ruby/gems/1.8/gems/merb-core-1.0/bin/merb:11 | |
from /usr/bin/merb:19:in `load' | |
from /usr/bin/merb:19 |
OlderNewer