Skip to content

Instantly share code, notes, and snippets.

View aaronrussell's full-sized avatar

Aaron Russell aaronrussell

View GitHub Profile

Keybase proof

I hereby claim:

  • I am aaronrussell on github.
  • I am aaronrussell (https://keybase.io/aaronrussell) on keybase.
  • I have a public key whose fingerprint is A5E8 8A17 8733 A3F8 34E9 A5DC D473 0945 D851 15F4

To claim this, I am signing this object:

@aaronrussell
aaronrussell / post-receive
Created April 15, 2015 08:40
Python gitolite post receive hook
#!/usr/bin/env python
import sys
import urllib, urllib2
import re
import os
import subprocess
from datetime import datetime
import simplejson as json
@aaronrussell
aaronrussell / 1.terminal.sh
Last active August 29, 2015 14:27
Refresh embeds on discourse
cd /var/discourse
sudo ./launcher enter app
cd /var/www/discourse
rails c
@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;}