Skip to content

Instantly share code, notes, and snippets.

@designermonkey
designermonkey / data_1.xml
Created February 12, 2013 23:06
Using Names and Matches together in XSL templates, we can choose and apply templates dynamically, based on content provided within the XML being transformed. I've searched for ages on how to do this properly, and a number of sources led me to this solution.
<data>
<datasource>
<section handle="test-section">Test Section</section>
<entry>
<page-path handle="about">/about</page-path>
<page-title handle="about">About</page-title>
<title handle="about-this-company">About This Company</title>
<template>
<item id="2" handle="content" section-handle="page-templates" section-name="Page Templates">Content</item>
</template>
@jofralogo
jofralogo / responsiveMixinsF4.sass
Last active December 15, 2015 21:18
Useful responsive SCSS mixins for Foundation 4.
/*
_______
These simple SCSS/SASS mixins for Foundation 4 are made by me to deal with media-queries and have a clean code at the same time! ;)
****IMPORTANT****
Due to Foundation 4 uses mobile-first methodology, every $phone-"X" variable in these mixins defines the value for every screen size.
$desktop-"X" values overrides $phone-"X" values when the width of the window is 768px and above.
// After making the required edits below, use something like http://daringfireball.net/2007/03/javascript_bookmarklet_builder to create the bookmarklet.
(function(){
var form=document.createElement("form");
// Edit the action value to match your domain and section names.
form.setAttribute("action","http://example.com/symphony/publish/entries/new/");
form.setAttribute("method","post");
// Edit the params to match your auth-token
// (found on the author page) and section fields.
@mirisuzanne
mirisuzanne / reference.mkdn
Created August 22, 2011 23:34
Susy 0.9 Reference Documentation

Susy 0.9 Reference Documentation

See the official Susy site for 1.0 documentation.

Terms

  • Susy Grid: A grid that you build with Susy. You can have multiple on one page if you need.
  • Grid Element: Any HTML element that is aligned to a Susy Grid.
  • Container: The root element in a Susy Grid. Anything inside it is a potential Grid Element.
@nitriques
nitriques / sync-starter-kit.sh
Last active March 16, 2018 22:54
sync-starter-kit.sh
#!/bin/bash
#function syncsk27 {
# pwd=`pwd`;
# cd /q;
# ./sync-starter-kit.2.7.sh $@;
# cd $pwd;
#}
VERSION=2.3.0
@tmos
tmos / wpmd 2 grav
Last active May 1, 2018 19:19
This script converts the headers from wp2md to Grav headers format
#! /bin/bash
#####################################################################################################
# == wpmd 2 grav == #
# This script converts the headers from wp2md to Grav headers format #
# wp2md : https://github.com/dreikanter/wp2md ; with `wp2md -d ./ export.xml -ps {title}/item.md` #
# Grav : http://getgrav.org/ #
# @author : Tom Canac http://tomcanac.com/ #
# @version : 0.1 #
# @licence : CC-BY #
@kenzie
kenzie / craft.conf
Last active May 17, 2018 17:48
Nginx virtual host configuration for Craft CMS, PHP5-FPM, NGINX 1.2.1 and craft/config/general.php for friendly URLs.
server {
listen 80;
root /var/www/craft.dev/public;
index index.php index.html index.htm;
server_name craft.dev;
location / {
try_files $uri $uri/ @rewrites;
@netsensei
netsensei / nasa.xsl
Created September 26, 2015 14:46
Converts XML output of the US GSA Social Media API to CSV - http://registry.usa.gov/accounts.xml?agency_id=nasa
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="text" />
<xsl:variable name="delimiter" select="','" />
<!-- define an array containing the fields we are interested in -->
<xsl:variable name="fieldArray">
<field>service_id</field>
<field>account</field>
@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