Skip to content

Instantly share code, notes, and snippets.

View skrat's full-sized avatar

Dušan Maliarik skrat

View GitHub Profile
it "should set new post" do
get('/login', :login => chucks_attributes[:login], :password => chucks_attributes[:password])
Post.should_receive(:new)
dispatch_to(Posts, :index).should respond_successfully
end
require File.join(File.dirname(__FILE__), '..', 'spec_helper.rb')
given "logged in" do
login
end
describe Posts do
describe "index action" do
it "should respond correctly" do
dispatch_to(Posts, :index).should respond_successfully
merb : worker (port 4000) ~ Started request handling: Mon Oct 27 23:31:57 +0100 2008
merb : worker (port 4000) ~ Routed to: {"action"=>"index", "controller"=>"posts"}
merb : worker (port 4000) ~ Params: {"action"=>"index", "controller"=>"posts"}
~ SELECT COUNT(*) FROM "users"
merb : worker (port 4000) ~ Redirecting to: /signup (302)
~ SELECT "id", "title", "per_page" FROM "streams" ORDER BY "id" LIMIT 1
merb : worker (port 4000) ~ undefined method `title' for nil:NilClass - (NoMethodError)
/home/skrat/workspace/slog/app/views/posts/index.html.haml:1:in `__home__skrat__workspace__slog__app__views__posts__index_html_haml'
#!/usr/bin/env bash
rvm use 1.9.2
echo $@
which ruby
echo $PATH
echo ----
@skrat
skrat / gist:1243458
Created September 26, 2011 21:27
Fixing queue args test
diff --git a/test/harness.js b/test/harness.js
index 1fefb76..3b4954c 100644
--- a/test/harness.js
+++ b/test/harness.js
@@ -13,7 +13,11 @@ var implOpts = {
defaultExchangeName: 'amq.topic'
};
-global.connection = amqp.createConnection(options, implOpts);
+global.makeConnection = function() {
@skrat
skrat / py3k_darwing_ae7375be86.patch
Created November 10, 2011 22:09
py3k patch pylibmc
diff --git a/_pylibmcmodule.c b/_pylibmcmodule.c
index 7704682..e2da236 100644
--- a/_pylibmcmodule.c
+++ b/_pylibmcmodule.c
@@ -46,6 +46,26 @@
{ Py_INCREF(obj); \
PyModule_AddObject(mod, nam, obj); }
+size_t
+strnlen(const char *s, size_t maxlen)
diff --git a/src/extras/loaders/ColladaLoader.js b/src/extras/loaders/ColladaLoader.js
index 18b1d98..a30aba7 100644
--- a/src/extras/loaders/ColladaLoader.js
+++ b/src/extras/loaders/ColladaLoader.js
@@ -1846,6 +1846,9 @@ THREE.ColladaLoader = function () {
for ( i = 0; i < this.primitives.length; i ++ ) {
var primitive = this.primitives[ i ];
+ if (primitive.count == 0) {
+ continue;
@skrat
skrat / gist:3181775
Created July 26, 2012 12:34
Backbone.Model getters/setter for default attributes
/**
* Defines getter/setter properties using Backbone.Model defaults
* @param {Function} ctor constructor of Bakcbone.Model
*/
function defaultProperties(ctor) {
if (!ctor.prototype.defaults)
return;
var defattr = function(name) {
Object.defineProperty(ctor.prototype, name, {
get: function() {
.fp-flipcard {
perspective: 1000px;
-webkit-perspective: 1000px;
-moz-perspective: 1000px;
}
.fp-flipcard .fp-faces {
transition: transform 1s;
-webkit-transition: -webkit-transform 1s;
-moz-transition: -moz-transform 1s;
function(func, hasher) {
var cache = {},
queue = {};
hasher = hasher || JSON.stringify;
return function() {
var args = Array.prototype.splice.call(arguments, 0);
var callback = args.pop();
var hash = hasher(args);
if (hash in cache) {
callback.apply(this, cache[hash]);