Skip to content

Instantly share code, notes, and snippets.

@nathanhornby
nathanhornby / master.xsl
Last active July 11, 2022 20:06
An HTML5 master utility template for SymphonyCMS (XSLT).
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="html" encoding="UTF-8" indent="yes" />
<xsl:template match="/">
<xsl:text disable-output-escaping="yes">&lt;</xsl:text>!DOCTYPE html<xsl:text disable-output-escaping="yes">&gt;</xsl:text>
<xsl:text disable-output-escaping="yes"><![CDATA[
<!--[if lt IE 7 ]> <html lang="en" class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
<!--[if IE 7 ]> <html lang="en" class="no-js lt-ie9 lt-ie8"> <![endif]-->
@bzerangue
bzerangue / recursive-convert-js-to-coffeescript.sh
Created December 11, 2012 00:23
RECURSIVELY Bash convert Javascript to Coffeescript; and also Coffeescript to Javascript
find . -name "*.js" | while read i; do js2coffee "$i" > "${i%.*}.coffee"; done
@vlad-ghita
vlad-ghita / symphony_meet_resources.md
Last active December 1, 2018 16:48
Symphony, meet Resources!

1 Intro

[Symphony][1] is great. Let's make it better.

This article is about the process of building your website's frontend, keeping templates DRY, relating Datasources, Events and other Resources to your Pages, code structure and much more. The following haven arisen, in time, from finding myself repeating the same things over and over again.

I assume you know what [master.xsl][2] is and you are using it. If you don't know, check the [default Symphony workspace][3].

2 It all starts with a requirement

@bzerangue
bzerangue / haml2html-recursive.sh
Created April 26, 2012 23:16
RECURSIVELY Bash convert HTML to HAML; and also HAML to HTML; sass-convert from css to scss AND back from scss to css
find . -name "*.haml" | while read i; do haml -f xhtml -q "$i" "${i%.*}.html"; done
@brendo
brendo / backend.html
Created April 13, 2012 15:14
Symphony Backend markup
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<!-- Core styles -->
<link rel="stylesheet" type="text/css" media="screen" href="http://example.com/symphony/assets/css/symphony.css">
<link rel="stylesheet" type="text/css" media="screen" href="http://example.com/symphony/assets/css/symphony.legacy.css">
<link rel="stylesheet" type="text/css" media="screen" href="http://example.com/symphony/assets/css/symphony.grids.css">
@brendo
brendo / event.google_calendar_import.php
Created March 29, 2012 14:05
Google Calendar Event
<?php
require_once EXTENSIONS . '/xmlimporter/extension.driver.php';
require_once EXTENSIONS . '/google_calendar_api/lib/class.json_to_xml.php';
require_once TOOLKIT . '/class.gateway.php';
Class eventgoogle_calendar_import extends Event {
const ROOTELEMENT = 'google-calendar-import';
const GOOGLE_ENDPOINT = 'https://www.googleapis.com/calendar/v3/calendars/%s/events?fields=%s&key=%s';
# rewrite from example.com to www.example.com
server {
listen 80;
server_name example.com;
rewrite ^(.+?)/?$ http://www.example.com$1 permanent;
}
server {
listen 80;
server_name www.example.com;
location / {
index index.php;
# serve static files directly
if (-f $request_filename) {
access_log off;
expires 30d;
break;
}
<?xml version="1.0" encoding="UTF-8"?>
<html>
<head>
<link rel="stylesheet" href="workspace/assets/style.css"/>
</head>
<body>
<div id="head">
<h1>Title</h1>
</div>
<div id="package">
@bauhouse
bauhouse / home.xml
Created October 27, 2011 22:23
Master XSL Template with overrides
<?xml version="1.0" encoding="utf-8" ?>
<data>
<params>
<today>2011-10-27</today>
<current-time>16:00</current-time>
<this-year>2011</this-year>
<this-month>10</this-month>
<this-day>27</this-day>
<timezone>-07:00</timezone>
<website-name>Symphony CMS</website-name>