Skip to content

Instantly share code, notes, and snippets.

@lennart
lennart / gist:106469
Created May 4, 2009 13:55
List of reichelt things to buy
*lm 386 (audio power amp)
100micro farad caps
220 micro farad caps
10 ohm resistors
0.01 micro farad caps
0.047 micro farad caps
*3.5mm jacks/ male/ female
schrumpfschläuche
darlington array
9v battery clip
Fehler: Die URL http://web.wi2.phil.tu-bs.de/cgi-bin/mesias.pl kann nicht geladen werden! Ein-/Ausgabefehler!
org.apache.commons.httpclient.ConnectTimeoutException: The host did not accept the connection within timeout of 5000 ms at org.apache.commons.httpclient.protocol.ReflectionSocketFactory.createSocket(ReflectionSocketFactory.java:154) at org.apache.commons.httpclient.protocol.DefaultProtocolSocketFactory.createSocket(DefaultProtocolSocketFactory.java:124) at org.apache.commons.httpclient.HttpConnection.open(HttpConnection.java:706) at org.apache.commons.httpclient.HttpMethodDirector.executeWithRetry(HttpMethodDirector.java:386) at org.apache.commons.httpclient.HttpMethodDirector.executeMethod(HttpMethodDirector.java:170) at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:396) at org.apache.commons.httpclient.HttpClient.executeMethod(HttpClient.java:324) at de.tu_bs.cms.portlet.ExternalScript.doView(ExternalScript.java:179) at javax.portlet.GenericPortlet.doDispatch(GenericPortlet
diff --git a/ext/id3lib_api/id3lib_api_wrap.cxx b/ext/id3lib_api/id3lib_api_wrap.cxx
index aaae53b..a545d38 100644
--- a/ext/id3lib_api/id3lib_api_wrap.cxx
+++ b/ext/id3lib_api/id3lib_api_wrap.cxx
@@ -854,7 +854,6 @@ SWIG_UnpackDataName(const char *c, void *ptr, size_t sz, const char *name) {
#include <ruby.h>
-
/* Remove global macros defined in Ruby's win32.h */
diff --git a/ext/id3lib_api/id3lib_api_wrap.cxx b/ext/id3lib_api/id3lib_api_wrap.cxx
index aaae53b..a545d38 100644
--- a/ext/id3lib_api/id3lib_api_wrap.cxx
+++ b/ext/id3lib_api/id3lib_api_wrap.cxx
@@ -854,7 +854,6 @@ SWIG_UnpackDataName(const char *c, void *ptr, size_t sz, const char *name) {
#include <ruby.h>
-
/* Remove global macros defined in Ruby's win32.h */
diff --git a/lib/couch_potato/view/model_view_spec.rb b/lib/couch_potato/view/model_view_spec.rb
index 844d6e0..fe11779 100644
--- a/lib/couch_potato/view/model_view_spec.rb
+++ b/lib/couch_potato/view/model_view_spec.rb
@@ -18,7 +18,7 @@ module CouchPotato
def map_function
"function(doc) {
- if(doc.ruby_class && doc.ruby_class == '#{@klass.name}') {
+ if(doc.#{JSON.create_id} && doc.#{JSON.create_id} == '#{@klass.name}') {
function(doc) {
if(!doc['descends_from'] && doc['body']) {
emit([doc._id],1);
}
if(doc['descends_from'] && doc['body']) {
emit(doc.descends_from.concat([doc.created_at,doc._id]),1);
}
}
def self.with_replies(id, options = {})
options.merge!(:startkey => [id], :endkey => [id,{}], :raw => true, :include_docs => true)
#by_replies calls the view with map_hierarchy.js as the map function
raw_replies = by_replies(options)
return [] if raw_replies.empty?
class_eval do
raw_replies["rows"].map do |row|
if row["key"].size == 1
new(row["doc"])
else
@lennart
lennart / gist:245485
Created November 30, 2009 15:11
irbrc
# Some default enhancements/settings for IRB, based on
# http://wiki.rubygarden.org/Ruby/page/show/Irb/TipsAndTricks
unless defined? ETC_IRBRC_LOADED
# Require RubyGems by default.
require 'rubygems'
# Activate auto-completion.
require 'irb/completion'
<s:states>
<s:State name="paused" />
<s:State name="normal" basedOn="{data.state}"/>
<s:State name="hovered" basedOn="{data.state}"/>
<s:State name="running"/>
<s:State name="pausedComplete" />
<s:State name="seeding"/>
</s:states>
@lennart
lennart / gist:267660
Created January 2, 2010 20:39
Who am I connected to over SSH? (Admin: Who is connected to me?)
lsof | sed -n "s/^\(sshd*\).*TCP \(\(.*\):[0-9][0-9]*\) (ESTABLISHED)$/\U\1:\L \2/p"