This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="UTF-8" standalone="yes"?> | |
<mozzarella> | |
<menu> | |
<links> | |
<link default="projects" label="Projects"> | |
<menu> | |
<links> | |
<link node="projects" label="Projects"/> | |
<link node="specialisations" label="Specialisations"/> | |
</links> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<div id="competition" class="pushSidebar contentWrap"> | |
<div id="innerWrap" class="clearFix"> | |
<div id="primary"> | |
<h1>Win a pair of Supra Blah</h1> | |
<p class="intro">Fill in your details to win.</p> | |
<form action="/competition/enter" method="post"> | |
<fieldset> | |
<div class="field"> | |
<label for="name">Name</label> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#competition h1 { | |
margin-left: 0; | |
margin-bottom: 16px; | |
} | |
#competition .intro { | |
margin-bottom: 25px; | |
} | |
#competition #primary { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<record tableName="homepage_boxes" tableUrl="homepage-boxes" name="Homepage Boxes"> | |
<fields> | |
<section name=""> | |
<link field="box_type" name="Type" type="dropdown" tableName="homepage_box_types" uid="homepageboxtype"> | |
<linkOptions field="name" orderBy="name ASC" allowNull="false"/> | |
</link> | |
<templateGroup name="News Types" link="homepageboxtype"> | |
<template id="1" name="Section"> | |
<text field="transition_every" name="Transition Every" width="80" comment="1/1000th second"/> | |
</template> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class Competition_Validation extends Validation { | |
protected $competition; | |
protected $guess; | |
public function init(){ | |
$this->add_rule( 'name' , 'required' ); | |
$this->add_rule( 'email' , 'required' ); | |
$this->add_rule( 'email' , 'email' ); | |
$this->add_rule( 'answer' , array( $this , 'valid_competition' ) ); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
in functions.php | |
if ( function_exists( 'add_theme_support' ) ) { | |
add_theme_support( 'post-thumbnails' ); | |
set_post_thumbnail_size( 150, 150 ); // default Post Thumbnail dimensions | |
add_image_size('homepage-image', 327, 218, true); | |
add_image_size('single-image', 675, 450, true); | |
} | |
then in the single.php i have |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function myfloor( $value , $precision = 0 ){ | |
$multiplier = (int) ("1" . str_repeat( 0 , $precision )); | |
return floor( $value * $multiplier ) / $multiplier; | |
} | |
function myceil( $value , $precision = 0 ){ | |
$multiplier = (int) ("1" . str_repeat( 0 , $precision )); | |
return ceil( $value * $multiplier ) / $multiplier; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'net/http' | |
require 'uri' | |
Earthquake.init do | |
output_filter do |item| | |
next unless item['text'] | |
text = item["text"] | |
text.scan( /http:\/\/t\.co\/[a-zA-Z0-9\-]+/ ).each do |url| | |
uri = URI.parse url | |
Net::HTTP::start( uri.host , uri.port ) do |connection| | |
connection.request_get uri.path do |response| |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
require 'net/http' | |
require 'uri' | |
require 'nokogiri' | |
html = Nokogiri::HTML( Net::HTTP.get( URI.parse( 'http://old.jamesmoss.co.uk/ajn.php' ) ) ) | |
out = [] | |
html.xpath( '//p' ).to_a.each do |p| | |
out.push p.to_s |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
case "casestudy": | |
$meta = getmeta($info->id, 'casestudy'); | |
$title = $meta->meta_title; | |
$link = "casestudy/".$info->url; | |
$backtrace .= ' > <a href="/casestudies-hub/">Case Studies</a>'; | |
break; | |
case "faq": | |
$title = $info->question; | |
$link = "faq/"; |
OlderNewer