Skip to content

Instantly share code, notes, and snippets.

View martisj's full-sized avatar
🐊

Martin Sjåstad martisj

🐊
View GitHub Profile
@martisj
martisj / gist:2311060
Created April 5, 2012 13:33
leiningen error message
Error: Failed executing: /usr/local/Cellar/leiningen/1.7.1/bin/lein self-install (leiningen.rb:12)
/System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/timeout.rb:60:in `rbuf_fill': execution expired (Timeout::Error)
from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/net/protocol.rb:134:in `rbuf_fill'
from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/net/protocol.rb:116:in `readuntil'
from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/net/protocol.rb:126:in `readline'
from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/net/http.rb:2024:in `read_status_line'
from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/net/http.rb:2013:in `read_new'
from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/net/http.rb:1050:in `request'
from /System/Library/Frameworks/Ruby.framework/Versions/1.8/usr/lib/ruby/1.8/open-uri.rb:248:in `open_http'
from /
@martisj
martisj / gemerror.log
Created May 13, 2012 00:46
gem error
gem server 10:34:27
ERROR: Loading command: server (LoadError)
dlopen(/Users/martin/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/x86_64-darwin10.8.0/zlib.bundle, 9): Library not loaded: libz.1.2.5.dylib
Referenced from: /Users/martin/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/x86_64-darwin10.8.0/zlib.bundle
Reason: image not found - /Users/martin/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/x86_64-darwin10.8.0/zlib.bundle
ERROR: While executing gem ... (NameError)
uninitialized constant Gem::Commands::ServerCommand
@martisj
martisj / gem_error.log
Created May 15, 2012 15:22
gem update error
[~] gem update 1:21:31
ERROR: Loading command: update (LoadError)
dlopen(/Users/martin/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/x86_64-darwin10.8.0/zlib.bundle, 9): Library not loaded: libz.1.2.5.dylib
Referenced from: /Users/martin/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/x86_64-darwin10.8.0/zlib.bundle
Reason: image not found - /Users/martin/.rvm/rubies/ruby-1.9.2-p290/lib/ruby/1.9.1/x86_64-darwin10.8.0/zlib.bundle
ERROR: While executing gem ... (NameError)
uninitialized constant Gem::Commands::UpdateCommand
@martisj
martisj / guard-err.log
Created May 20, 2012 03:07
guard error messages
/Users/martin/.rvm/gems/ruby-1.9.2-p290/gems/rb-appscript-0.6.1/lib/appscript.rb:542:in `_send_command': CommandError (Appscript::CommandError)
OSERROR: -10000
MESSAGE: Apple event handler failed.
COMMAND: app("/Library/PreferencePanes/Growl.prefPane/Contents/Resources/GrowlHelperApp.app").register({:all_notifications=>["success", "pending", "failed", "notify"], :as_application=>"Guard", :default_notifications=>"notify"})
from /Users/martin/.rvm/gems/ruby-1.9.2-p290/gems/rb-appscript-0.6.1/lib/appscript.rb:642:in `method_missing'
from /Users/martin/.rvm/gems/ruby-1.9.2-p290/gems/growl_notify-0.0.3/lib/growl_notify.rb:29:in `register'
from /Users/martin/.rvm/gems/ruby-1.9.2-p290/gems/growl_notify-0.0.3/lib/growl_notify.rb:19:in `config'
from /Users/martin/.rvm/gems/ruby-1.9.2-p290/gems/guard-1.0.3/lib/guard/notifiers/growl_notify.rb:42:in `available?'
from /Users/martin/.rvm/gems/ruby-1.9.2-p290/gems/guard-1.0.3/lib/guard/notifier.rb:119:in `add_notification'
from /Users/martin/.rvm/gems/ruby-1.9.2
require 'spec_helper'
describe "Tasks" do
describe "GET /tasks" do
it "display some tasks" do
@task = Task.create :task => 'go to bed'
visit tasks_path
page.should have_content 'go to bed'
require 'spec_helper'
# describe "Tasks" do
# describe "GET /tasks" do
# it "display some tasks" do
# @task = Task.create :task => 'go to bed'
# visit tasks_path
# page.should have_content 'go to bed'
@martisj
martisj / feed.php
Created May 21, 2012 12:20
doctrine object retrieval
$post = new models\Post;
$user = get_user($uid);
$post->setUser($user);
$embedly_post = $this->embedly_post($user_post);
$post->setContent($embedly_post);
$post->setCategory($type);
$post->setCampus_id($cid);
$post->setDate_order(date_create(now_mysql()));
$post->setDate_created(date_create(now_mysql()));
@martisj
martisj / dabblet.css
Created August 3, 2012 08:22 — forked from anonymous/dabblet.css
Lining up form elements
/**
* Lining up form elements
*/
@martisj
martisj / post_to_class_feed.py
Created August 29, 2012 06:39
delete comment
def test_delete_comment(self):
driver = self.driver
uid = uuid.uuid4()
sentence = self._create_random_sentence()
comment_text = str(uid) + ' | ' + sentence
driver.find_element_by_link_text(self.unit_code).click()
comments_count = len(driver.find_elements_by_css_selector('.comments_container li'))
@martisj
martisj / home.php
Created September 6, 2012 11:27
Controller method that parses data for the view
// group the notifications by entity_id
$groups = array();
foreach($notifications as $notif){
$entity_id = $notif->get_entity_id();
// echo $entity_id;
$entity = $this->em->getRepository('models\\'.$notif->get_entity_type())->find($entity_id);
$type = $notif->get_type();
// notification are grouped together. ww: changed array key to now include the type of
// notifcation as to not get 2 types with the same id creating one alert