Skip to content

Instantly share code, notes, and snippets.

View olleolleolle's full-sized avatar
🙌
In sunny Malmö in Sweden 🌞

Olle Jonsson olleolleolle

🙌
In sunny Malmö in Sweden 🌞
View GitHub Profile
@olleolleolle
olleolleolle / gist:26094
Created November 18, 2008 10:22
A little bug, fixed.
Index: /Users/olle/opensource/python/pinax-readonly/projects/complete_project/templates/tribes/tribe.html
===================================================================
--- /Users/olle/opensource/python/pinax-readonly/projects/complete_project/templates/tribes/tribe.html (revision 1208)
+++ /Users/olle/opensource/python/pinax-readonly/projects/complete_project/templates/tribes/tribe.html (working copy)
@@ -132,7 +132,7 @@
{% tweet_listing tweets 1 0 %}
<h2>{% trans "Upcoming Events" %}</h2>
- {% get_calendar_for_object tribe as calendar %}
+ {% get_calendar tribe as calendar %}
@olleolleolle
olleolleolle / thing.py
Created November 19, 2008 15:15
My problem with Projects was that anyone could list projects that they were not a member of. I hate that.
import things
from django.db import connection
from django.http import HttpResponse, Http404
from django.template import RequestContext
from things.fields import BaseField, AggregateBase, DESCENDING
from django.template.loader import select_template
class ProjectThing(things.Thing):
created = things.OrderField(
if (column && column.editor && column.editor.field && ( column.editor.field.isXType('eosnumberfield') || column.editor.field.isXType('eosdirectentryfield') ) ) {
//top.dl('keyCode:' + e.keyCode + '/charCode:'+e.charCode+ '/fromCharCode:'+String.fromCharCode(e.charCode));
valueForEditor = String.fromCharCode(e.getCharCode());
}
@olleolleolle
olleolleolle / mediawiki_export.py
Created February 9, 2009 15:11
Here is a sample usage of the mwclient API (MediaWiki used with Python)
import mwclient
username = u'WikiSysop'
password = u's3cr3t'
#site = mwclient.Site(('https', host), path = '/mediawiki-1.14.0rc1/')
host = u'tools'
site = mwclient.Site(host, path=u'/mediawiki-1.14.0rc1/')
site.login(username, password)
# Edit page
@olleolleolle
olleolleolle / arduino_syntax_coloring.diff
Created March 1, 2009 17:48
Support for Arduino's syntax in Bespin (the Mozilla code editor).
diff -r 601a944a1639 frontend/js/bespin/bootstrap_dependencies.js
--- a/frontend/js/bespin/bootstrap_dependencies.js Sat Feb 28 22:26:57 2009 -0800
+++ b/frontend/js/bespin/bootstrap_dependencies.js Sun Mar 01 18:44:18 2009 +0100
@@ -59,6 +59,7 @@
dojo.require("bespin.syntax.css");
dojo.require("bespin.syntax.html");
dojo.require("bespin.syntax.php");
+dojo.require("bespin.syntax.arduino");
dojo.require("bespin.cmd.commandline");
@olleolleolle
olleolleolle / adding_compilefile_command.diff
Created March 1, 2009 22:23
here is a weird idea added to Bespin
diff -r ff80ef4e11e9 backend/python/bespin/controllers.py
--- a/backend/python/bespin/controllers.py Sun Mar 01 19:42:53 2009 +0100
+++ b/backend/python/bespin/controllers.py Sun Mar 01 23:22:44 2009 +0100
@@ -191,6 +191,18 @@
fm.close(user, project, path)
return response()
+
+@expose(r'^/file/compile/(?P<path>.*)$', 'POST')
+def compilefile(request, response):
@olleolleolle
olleolleolle / docs_in_events_js.diff
Created March 2, 2009 21:25
Small changes, fixing cut n paste errors.
diff -r a41a063efa69 frontend/js/bespin/events.js
--- a/frontend/js/bespin/events.js Mon Mar 02 21:55:02 2009 +0100
+++ b/frontend/js/bespin/events.js Mon Mar 02 22:25:11 2009 +0100
@@ -78,7 +78,7 @@
// ** {{{ Event: bespin:editor:config:run }}} **
//
-// Load the users config file
+// Load the user's config file
bespin.subscribe("bespin:editor:config:run", function(event) {
@olleolleolle
olleolleolle / bugfix_createproject.diff
Created March 2, 2009 21:34
on creating a project, the refresh of the project list is borked due to closure miss
diff -r a41a063efa69 frontend/js/bespin/dashboard/dashboard.js
--- a/frontend/js/bespin/dashboard/dashboard.js Mon Mar 02 21:55:02 2009 +0100
+++ b/frontend/js/bespin/dashboard/dashboard.js Mon Mar 02 22:33:42 2009 +0100
@@ -134,7 +134,7 @@
},
refreshProjects: function() {
- _server.list(null, null, displayProjects);
+ _server.list(null, null, bd.displayProjects);
}
diff --git a/jquery.jeditable.ajaxupload.js b/jquery.jeditable.ajaxupload.js
index a211183..bedafb7 100644
--- a/jquery.jeditable.ajaxupload.js
+++ b/jquery.jeditable.ajaxupload.js
@@ -44,7 +44,7 @@ $.editable.addInputType('ajaxupload', {
error: function (data, status, e) {
alert(e);
}
- })
+ });
javascript:var%20t=((window.getSelection&&window.getSelection())||(document.getSelection&&document.getSelection())||(document.selection&&document.selection.createRange&&document.selection.createRange().text));var%20e=(document.charset||document.characterSet);if(t!=''){location.href='http://translate.google.com/translate_t?text='+t+'&hl=en&langpair=pl|sv&tbb=1&ie='+e;}else{location.href='http://translate.google.com/translate?u='+escape(location.href)+'&hl=en&langpair=pl|sv&tbb=1&ie='+e;};