Skip to content

Instantly share code, notes, and snippets.

View larscwallin's full-sized avatar

Lars Wallin larscwallin

View GitHub Profile
#!flask/bin/python
from flask import Flask, jsonify, abort, request, make_response, url_for
from flask.ext.httpauth import HTTPBasicAuth
app = Flask(__name__, static_url_path = "")
auth = HTTPBasicAuth()
@auth.get_password
def get_password(username):
if username == 'miguel':
// svg.textflow.js 0.8 - Copyright (c) 2013 Wout Fierens - Licensed under the MIT license
SVG.Textflow = function() {
this.constructor.call(this, SVG.create('text'))
/* define default style */
this.styles = {
'font-size': 16
, 'font-family': 'Helvetica, Arial, sans-serif'
, 'text-anchor': 'start'
@larscwallin
larscwallin / export_to_any.py
Created May 24, 2011 16:34
Inkscape extension to export svg to misc formats. Will focus on xhtml
#!/usr/bin/env python
# This script was written by Lars Wallin to facilitate export from svg to any output basically.
# For now only bitmap rendering is supported (to some degree...)
# Future versions should include rendering of canvas documents (css, html, ddh, ...)
# Please note that i have not run this script since i added this verbose commenting, so i might have broken some tab position or something...
import inkex
@larscwallin
larscwallin / simplx_template_example
Created June 1, 2011 13:46
Sharable Property Set for SIMPLX Template
[{"name":"body_background_color","desc":"This property sets the background color for the body of the page.","xtype":"textfield","options":[],"value":"#391732","lexicon":null,"overridden":1,"desc_trans":"This property sets the background color for the body of the page.","menu":null},{"name":"body_background_image","desc":"","xtype":"textfield","options":[],"value":"http://jenruhman.com/freshjen/free_twitter_-color-background_freshjen_3.jpg","lexicon":null,"overridden":1,"desc_trans":"","menu":null},{"name":"body_background_image_repeat","desc":"","xtype":"list","options":[{"text":"No repeat","value":"no-repeat","name":"No repeat"},{"text":"Repeat horizontal","value":"repeat-x","name":"Repeat horizontal"},{"text":"Repeat vertical","value":"repeat-y","name":"Repeat vertical"},{"text":"Tile","value":"repeat","name":"Tile"}],"value":"repeat","lexicon":null,"overridden":false,"desc_trans":"","menu":null},{"name":"body_custom_css","desc":"Override the default template css","xtype":"textarea","options":[],"value":"",
@larscwallin
larscwallin / gridFilter.js
Created June 8, 2011 21:55
ExtJs Grid filter
/**
* Ext.ux.grid.GridFilters v0.2.8
**/
Ext.namespace("Ext.ux.grid");
/* PATCH http://extjs.com/forum/showthread.php?t=76280 */
Ext.override(Ext.grid.GridView, {
handleHdMenuClick : function(item){
var index = this.hdCtxIndex,
cm = this.cm,
@larscwallin
larscwallin / simplx_template_2_1.js
Created June 13, 2011 12:15
simplx_template_2_1
[{"name":"body_background_color","desc":"This property sets the background color for the body of the page.","xtype":"textfield","options":[],"value":"#fff","lexicon":null,"overridden":false,"desc_trans":"This property sets the background color for the body of the page.","menu":null},{"name":"body_background_image","desc":"","xtype":"textfield","options":[],"value":"","lexicon":null,"overridden":false,"desc_trans":"","menu":null},{"name":"body_background_image_repeat","desc":"","xtype":"list","options":[{"text":"No repeat","value":"no-repeat","name":"No repeat"},{"text":"Repeat horizontal","value":"repeat-x","name":"Repeat horizontal"},{"text":"Repeat vertical","value":"repeat-y","name":"Repeat vertical"},{"text":"Tile","value":"repeat","name":"Tile"}],"value":"repeat","lexicon":null,"overridden":false,"desc_trans":"","menu":null},{"name":"body_custom_css","desc":"Override the default template css","xtype":"textarea","options":[],"value":"","lexicon":null,"overridden":false,"desc_trans":"Override the default t
<?xml version="1.0" encoding="UTF-8"?>
<!--
/*
* visionCart
* Copyright 2010 by 1-vision.
* http://www.1-vision.nl
* http://www.visioncart.net
* All rights reserved.
*
* This program is free software; you can redistribute it and/or modify it under
@larscwallin
larscwallin / visioncart.getorders.php
Created June 16, 2011 10:49
visioncart.getorders
<?php
$query = $modx->newQuery('vcOrder');
$query->where(array(
'shopid' => $shopid
));
$query->sortby($sortBy, $sortOrder);
@larscwallin
larscwallin / visioncart_deleteorder_menufix_properties.js
Created June 17, 2011 08:23
visioncart_deleteorder_menufix_properties
[{"name":"menuItemName","desc":"","xtype":"textfield","options":[],"value":"Delete order","lexicon":null,"overridden":false,"desc_trans":"","menu":null}]
@larscwallin
larscwallin / visioncart.deleteorder.php
Created June 17, 2011 08:24
visioncart.deleteorder
<?php
if($useGetParam){
$orderId = $_GET[$getParamName];
if($orderId == ''){
return false;
}
}
if (!$orderId) {
$modx->log(modX::LOG_LEVEL_ERROR, 'Snippet Error: visioncart.deleteorder, parameter orderid missing.');