Skip to content

Instantly share code, notes, and snippets.

View larscwallin's full-sized avatar

Lars Wallin larscwallin

View GitHub Profile
@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
<inkscape-extension>
<_name>Create Sketch Layer</_name>
<id>com.larscwallin.create_sketch_layer</id>
<dependency type="executable" location="extensions">create_sketch_layer.py</dependency>
<dependency type="executable" location="extensions">inkex.py</dependency>
<!-- <param name="what" type="string" _gui-text="What?"></param> -->
<param name="where" type="string" _gui-text="Sketch save location"></param>
<param name="sketch_name" type="string" _gui-text="Sketch name"></param>
<param name="remove_border" type="boolean" _gui-text="Remove element border?"></param>
<param name="replace_source" type="boolean" _gui-text="Replace original element?"></param>
@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,
/*!
* Ext JS Library 3.2.1
* Copyright(c) 2006-2010 Ext JS, Inc.
* licensing@extjs.com
* http://www.extjs.com/license
*/
Ext.onReady(function(){
Ext.QuickTips.init();
@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.php
Created June 17, 2011 08:19
visioncart_deleteorder_menufix
<?php
$modx->regClientStartupHTMLBlock('
<script type="text/javascript">
Ext.onReady(function(){
var qsParams = Ext.urlDecode(window.location.search.substring(1));
this.updateContextMenu = function (){
var orderMenu = Ext.select(".x-menu.x-menu-floating",true);
if(orderMenu.elements[0]){
var elementId = orderMenu.elements[0].id;
@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}]