Skip to content

Instantly share code, notes, and snippets.

@arjan
arjan / import-new-release.sh
Created June 8, 2011 19:54
Quickly import a python package with git-buildpackage
#!/bin/sh
set -e
SRCPKG=`python -B setup.py --name`
PKG=`basename $PWD`
DISTDIR="../../$PKG/dist"
RELEASE=`ls $DISTDIR -t|head -n 1|sed 's/\.tar\.gz//'|sed s/${SRCPKG}-//`
if [ "`git tag|grep upstream/$RELEASE`" != "" ]; then
=ERROR REPORT==== 27-Dec-2011::15:37:27 ===
** Generic server <0.119.0> terminating
** Last message in was summary
** When Server state == {state,true,
{state,0.95,0.04,847,
[{3,5},
{4,11},
{5,26},
{6,45},
{7,72},
+ case DbDatabase of
+ undefined ->
+ % Use zotonic config and per host+node schema
+ DbDatabase1 = z_config:get(dbdatabase, "zotonic"),
+ DbSchema = atom_to_list(Host) ++ "+" ++ hd(string:tokens(atom_to_list(node()), "@"));
+ _ ->
+ DbDatabase1 = DbDatabase,
+ DbSchema = proplists:get_value(dbschema, SiteProps, z_config:get(dbschema))
+ end,
@arjan
arjan / AndroidManifest.xml
Created February 13, 2012 21:02
Android manifest for Sharing button
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="nl.miraclethings.arris"
android:versionCode="1"
android:versionName="1.0">
<uses-sdk android:minSdkVersion="9" />
<uses-permission android:name="android.permission.INTERNET"></uses-permission>
<application android:icon="@drawable/icon" android:label="@string/app_name">
<activity android:label="@string/app_name" android:name="MainActivity">
@arjan
arjan / gist:1827297
Created February 14, 2012 14:52
Component [FinancialTransaction] De boeking is niet in evenwicht op: 2012 / 2 (Type: Overige) - Verschil: EUR -17,56
<?xml version="1.0" encoding="UTF-8"?>
<eExact xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="eExact-XML.xsd">
<GLTransactions>
<GLTransaction entry="666">
<Journal code="81" />
<Description>
<![CDATA[Realisation of Market buy-order 34 by amount: €110.00 (± 137.638 gr.) [realising]]]>
</Description>
<GLTransactionLine>
<Date>2012-02-14</Date>
@arjan
arjan / gist:2359320
Created April 11, 2012 13:34
Zotonic releaes notes 0.8.0
Welcome Zotonic 0.8.0, released on April 11, 2012
These are the changes for Zotonic release 0.8.0. The most important
changes are summarized first, below that is a full "git shortlog" of all
changes since release 0.7.
New Modules
-----------
mod_oembed - Provides an easier way to embed external content into
@arjan
arjan / gist:2633806
Created May 8, 2012 09:16
Zotonic mail with too long lines
Delivered-To: [email protected]
Received: by 10.204.184.4 with SMTP id ci4csp335999bkb;
Tue, 8 May 2012 02:10:41 -0700 (PDT)
Received: by 10.213.35.194 with SMTP id q2mr1827376ebd.78.1336468241532;
Tue, 08 May 2012 02:10:41 -0700 (PDT)
Return-Path: <[email protected]>
Received: from goudentonamsterdam.nl (miffy.whatwebwhat.com. [80.69.73.11])
by mx.google.com with ESMTPS id e47si5957608eea.79.2012.05.08.02.10.41
(version=TLSv1/SSLv3 cipher=OTHER);
Tue, 08 May 2012 02:10:41 -0700 (PDT)
@arjan
arjan / git-submodule-updated
Created May 16, 2012 08:48
Automatically update and commit a parent repository when a submodule changed
#!/bin/bash
# Arjan Scherpenisse, 2012-05-16
#
# Automatically update and commit a parent repository when a submodule changed
DIR=$(dirname $PWD)
PART=$(basename $PWD)
cd ..
{% wire id="basket-form" type="submit" postback={add_to_cart id=id variant_id=variant_id action={redirect location="/cart"}} delegate="mod_shop" %}
<form id="basket-form" method="post" action="postback">
<table>
<tr>
<th>
Color
</th>
<td>
{% for id in id.o.has_variant %}
<a class="variant-link {% if id == variant_id
@arjan
arjan / gist:3332063
Created August 12, 2012 14:25
zotonic 2.0

The main idea is to split off Zotonic's functionality in a set of OTP apps. Each site will become its own app. Modules are treated specially. They are also erlang apps, containing a simple-one-for-one supervisor, in which each child process is an actual running instance of the module for a specific site.

The most powerful feature of zotonic is its extensibility and flexibility. Zotonic consists of one or more sites, each of which use functionality which is contained in modules. In the site context, tools exist to communicate between these through notifications: a prioritized publish/subscribe mechanism for the exchange of messages through maps and folds.

The z_core app will consist of functions for starting/stopping sites and modules, broadcasting notifications within sites, and code for the indexing of the module files (e.g. for template finding; z_module_indexer). For sites and modules, behaviours will be created to reduce the amount of boilerplate code when implementing sites/modules.