Skip to content

Instantly share code, notes, and snippets.

View aaronrussell's full-sized avatar

Aaron Russell aaronrussell

View GitHub Profile
@aaronrussell
aaronrussell / database.yml
Created July 8, 2009 17:07
Standard database.yml config file for MySQL-based Rails apps
# Standard database.yml file for MySQL-based Rails apps
# Development and Production environments share defaults
defaults: &defaults
adapter: mysql
encoding: utf8
host: localhost
username: db_username
password: db_password
@aaronrussell
aaronrussell / tinymce_communicate.php
Created September 24, 2009 10:42
tinymce_communicate TinyBrowser hack
<?php
/*
* 1. Find list line (about line 60)
*/
$replace = '<script type="text/javascript" src="' . trim($this->settings['script_path']) . '"></script>' . NL;
/*
* 2. Add DIRECTLY UNDERNEATH IT
*/
/*
Copyright (c) 2003-2009, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.html or http://ckeditor.com/license
*/
CKEDITOR.editorConfig = function( config )
{
// Define changes to default configuration here. For example:
// config.language = 'fr';
// config.uiColor = '#AADC6E';
var markers = [];
var geocoder = new google.maps.Geocoder();
var local_search = new GlocalSearch();
var default_point = new google.maps.LatLng(53.800651, -4.064941);
var default_map = {
zoom: 5,
center: default_point,
mapTypeControl: true,
mapTypeControlOptions: {style: google.maps.MapTypeControlStyle.DROPDOWN_MENU},
mapTypeId: google.maps.MapTypeId.ROADMAP
CKEDITOR.plugins.add('uploader',{
init:function(a){
var cmd = a.addCommand('uploader', {exec:uploader_onclick});
cmd.modes={wysiwyg:1,source:1};
cmd.canUndo=false;
a.ui.addButton('uploader',{ label:'Upload an Image..', command:'uploader', icon:this.path+'images/icon.gif' });
}
})
function uploader_onclick(e)
$('#insert_photo').submit(function()
{
var CKEDITOR = window.parent.CKEDITOR;
var url = $('input:checked[name="img[size]"]').val();
var class = $('input:checked[name="img[align]"]').val();
var alt = $('#photo_alt').val();
var img = '<img src="'+url+'" class="'+class+'" alt="'+alt+'" />';
CKEDITOR.instances.article_body.insertHtml(img);
window.parent.$.modal.close();
<!--
The effect I'm trying to achieve is to have a floated DIV which contains an image and a caption.
I can't guarantee the size of the image. It might be 200px, 400px or anything in-between.
I wan't the floated DIV to stay the width of the image, and then the caption underneath to wrap
onto multiple lines if it is wider than the image - rather than stretch the width of the DIV.
-->
<style>
/* Here's a simplified version of my CSS */
div {background: #cecece; float:left;}
# Taken from http://frst.in/~8r
# Configuration
set :application, "your.domain.com"
set :deploy_to, "/var/www/app"
set :repository, "git@github.com:username/project.git"
set :branch, "master"
set :user, "username"
# Additional SCM settings
div {
background-image: url('/images/background.png');
@media only screen and (-webkit-min-device-pixel-ratio: 2), only screen and (min-device-pixel-ratio: 2) {
background-image: url('/images/hi-background.png');
}
}
<!DOCTYPE html>
<html lang="en-GB">
<head>
<meta charset="utf-8">
<title>exercise.2.1</title>
</head>
<body>
<header>
<hgroup>
<h1>Web Directions USA</h1>