Skip to content

Instantly share code, notes, and snippets.

View kpricorn's full-sized avatar
⛷️

Sebastian de Castelberg kpricorn

⛷️
View GitHub Profile
@kpricorn
kpricorn / iter.xhtml
Created December 30, 2011 12:56
template
<n:invisible xmlns="http://www.w3.org/1999/xhtml" lang="en" xmlns:n="http://nevow.com/ns/nevow/0.1">
<h2>Nested-Iteration Test</h2>
<div n:data="rows" n:render="sequence" >
<n:invisible n:pattern="item" n:render="row"/>
<hr n:pattern="divider" />
</div>
</n:invisible>
@kpricorn
kpricorn / gist:1539716
Created December 30, 2011 12:55
Page and Fragment
class IterPage(WebConfig):
docFactory = loaders.xmlfile(util.sibpath(__file__, 'templates/iter.xhtml'))
addSlash = False
def data_rows(self, ctx, data):
return [
[ 1, 2, 3 ],
[ 1 ],
[ 1, 4, 9, 3 ],
]
@kpricorn
kpricorn / gist:1373092
Created November 17, 2011 13:03
gst-launch orc segfault
gst-launch videotestsrc ! fakesink
Setting pipeline to PAUSED ...
Pipeline is PREROLLING ...
Caught SIGSEGV accessing address 0xe755dd1
#0 0x00007fff8fa16df2 in select$DARWIN_EXTSN ()
#1 0x000000010e3754d3 in g_poll ()
#2 0x000000010e368e66 in g_main_context_iterate ()
#3 0x000000010e36a382 in g_main_loop_run ()
#4 0x000000010e1fe43e in gst_bus_poll ()
#5 0x000000010e1e2b99 in dyld_stub_strlen ()
@kpricorn
kpricorn / gist:1132070
Created August 8, 2011 16:14
upnp_ssdp_notify.py
from twisted.internet import reactor
from coherence.base import Coherence
config = {'interface': 'en0', 'logmode':'warning'}
c = Coherence(config)
def startUPnP():
c.ssdp_server.register('local',
"uuid:<uuid>",
"urn:<urn>",
@kpricorn
kpricorn / wget_content_disposition
Created December 13, 2010 09:26
pick filename from Content-Disposition header
We couldn’t find that file to show.
@kpricorn
kpricorn / df
Created December 9, 2010 10:17
df -hl -T -x noauto -x tmpfs -x none
@kpricorn
kpricorn / readability-hack.js
Created November 17, 2010 20:05
nodejs readability
var document;
var dbg = (typeof console !== 'undefined') ? function(s) {
console.log("Readability: " + s);
} : function() {};
/*
* Readability. An Arc90 Lab Experiment.
* Website: http://lab.arc90.com/experiments/readability
* Source: http://code.google.com/p/arc90labs-readability
@kpricorn
kpricorn / defined-or
Created October 26, 2010 23:49
C-style Logical Defined-Or in perl
$home = $ENV{'HOME'} // $ENV{'LOGDIR'} //
(getpwuid($<))[7] // die "You're homeless!\n";