Skip to content

Instantly share code, notes, and snippets.

@nickdunn
nickdunn / gist:1234414
Created September 22, 2011 09:32
Game question/answer example
<game>
<section id="2" handle="games">Games</section>
<entry id="225">
<title handle="near-field-communication">Near Field Communication</title>
<description mode="formatted">...</description>
<points>10</points>
<questions items="1">
<item id="224">
<question handle="what-must-you-do-with-two-nokia-devices-to-share-a-photo-via-nfc">What must you do with two Nokia devices to share a photo via NFC?</question>
<answer-a handle="tap-them-together">tap them together</answer-a>
@nickdunn
nickdunn / project-code-guidelines.txt
Created September 22, 2011 09:21
CSS and Javascript project code guidelines
All:
- Indent work with tabs. No spaces unless lining up variables or objects vertically.
- View your whitespace and make sure your editor cleans it up.
- Use UTF-8 encoding with UNIX line endings. No exceptions.
CSS:
- Indent your CSS to denote selector is a child of or extends the previous selector. Comment extensions.
- Name classes sensibly using hyphens if necessary. No CamelCase.
- Order properties sensibly - 1. layout 2. text 3. backgrounds - is a common pattern.
- No inline hacks or parsing bugs; put it in to the right stylesheet.
@import url("basic.css");
@import url("code.css");
/* Debug */
body {
padding-right: 21.25em;
background-color: #2b2b29;
color: #fff;
font-size: 75%;
}
/* Syntax Highlighting */
pre[class] {
margin-bottom: 1.5em;
border: 1px solid #393937;
overflow: hidden;
background-color: #191917;
white-space: normal;
font: inherit;
}
pre[class] code {
@nickdunn
nickdunn / extension.about.xml
Created July 29, 2011 15:44
Symphony extension meta XML
<?xml version="1.0" encoding="UTF-8" ?>
<extension id="search_index">
<!-- string, required -->
<name>Search Index</name>
<!-- string, required (@lang optional) -->
<description lang="en">Index text content of entries for efficient full-text search.</description>
@nickdunn
nickdunn / extension.driver.php
Created July 27, 2011 08:31
Symphony RDF content negotiation (hacky as crap)
<?php
require_once(CORE . '/class.frontend.php');
Class extension_seme4_semantics extends Extension {
public function about() {
return array('name' => 'Seme4 Semantics',
'version' => '1.1',
'release-date' => '2010-03-01',
'author' => array('name' => 'Nick Dunn',
@nickdunn
nickdunn / extension.about.xml
Created July 12, 2011 15:58
Symphony extension meta XML
<?xml version="1.0" encoding="UTF-8" ?>
<extension>
<name>Search Index</name>
<release>
<version>0.9.1</version>
<date>2011-07-08</date>
</release>
@nickdunn
nickdunn / gist:1033239
Created June 18, 2011 16:21
wtf queries busting my balls
SELECT
`e`.id, `e`.section_id, e.`author_id`, UNIX_TIMESTAMP(e.`creation_date`) AS `creation_date`
FROM
`sym_entries` AS `e`
LEFT JOIN `sym_entries_data_10` AS `sbl` ON (`e`.`id` = `sbl`.`relation_id`)
LEFT JOIN `sym_member_replies` AS `replies` ON (`e`.`id` = `replies`.`entry_id` AND `replies`.`member_id` = 1)
WHERE
1 AND `e`.`section_id` = '1'
GROUP BY
`e`.`id`
@nickdunn
nickdunn / gist:1031247
Created June 17, 2011 11:27
Symphony Textmate bundle

A Symphony Textmade bundle could include:

Templates (File > New from Template > Symphony)

  • Extension Driver
  • Data Source
  • Event
  • Field
  • JavaScript
  • README.markdown
@nickdunn
nickdunn / extension.driver.php
Created June 13, 2011 15:58
Extension: Save And Close
<?php
Class Extension_Save_And_Close extends Extension {
public function about() {
return array(
'name' => 'Save And Close',
'version' => '1.0'
);
}