Skip to content

Instantly share code, notes, and snippets.

View kim3er's full-sized avatar

Richard Kimber kim3er

View GitHub Profile
@kim3er
kim3er / output.html
Created December 16, 2011 11:10
Perch grouping workaround
<div class="fixture-container">
<table>
<thead>
<tr class="date">
<th colspan="7">
December 2011</th>
</tr>
<tr class="titles">
<th class="star">
&nbsp;</th>
@kim3er
kim3er / mobile-meta-links.html
Created May 16, 2012 09:04
iOS Web App Configuration
@kim3er
kim3er / for-()-{}.sublime-snippet
Created August 7, 2012 09:15
Sublime Text 2 JavaScript for snippet, built for speed.
<snippet>
<content><![CDATA[for (var ${20:i} = 0, ${30:l} = ${1:things}.length; ${20:i} < ${30:l}; ${20:i}++) {
${100:var ${40:thing} = ${1:things}[${20:i}];}$0
};]]></content>
<tabTrigger>for</tabTrigger>
<scope>source.js</scope>
<description>for (…) {…}</description>
</snippet>
@kim3er
kim3er / preferred.sublime-settings
Created August 10, 2012 10:08
Sublime Text 2 Syntax Settings
{
"tab_size": 4,
"translate_tabs_to_spaces": false
}
@kim3er
kim3er / config.php
Created August 10, 2012 15:36
Perch 2 config with multiple environments
<?php
$k3r_env = getenv('environment');
if ($k3r_env === 'kimber') {
define('PERCH_LICENSE_KEY', '');
define("PERCH_DB_USERNAME", '');
define("PERCH_DB_PASSWORD", '');
define("PERCH_DB_SERVER", "localhost");
define("PERCH_DB_DATABASE", "harewood");
function WebmailViewModel() {
// Data
var self = this;
self.folders = ['Inbox', 'Archive', 'Sent', 'Spamh'];
self.chosenFolderId = ko.observable();
self.chosenFolderData = ko.observable();
self.chosenMailData = ko.observable();
// Behaviours
self.goToFolder = function(folder) { location.hash = folder };
@kim3er
kim3er / jquery.sum.js
Created September 4, 2012 09:36
Sum, Max & Min functions in jQuery
(function ($) {
// DOM
if (!Array.prototype.sum)
Array.prototype.sum = function () {
for (var i = 0, l = this.length, sum = 0; i < l; sum += this[i++]);
return sum;
};
if (!Array.prototype.max)
Array.prototype.max = function () {
@kim3er
kim3er / rails-ntlm.conf
Created September 14, 2012 11:00
Virtual Host configuration for Rails with NTLM using mod_auth_sspi. <%= request.env["HTTP_X_FORWARDED_USER"] %> # Gets Username
<VirtualHost *:80>
ServerName cagv11
DocumentRoot "C:/web/testing/public"
ProxyPass / http://localhost:3000/
ProxyPassReverse / http://localhost:3000/
ProxyPreserveHost On
<Proxy *>
AuthName "Iconica"
@kim3er
kim3er / date.format.js
Created October 29, 2012 16:53
Date Format with IE fix.
/*
* Date Format 1.2.3
* (c) 2007-2009 Steven Levithan <stevenlevithan.com>
* MIT license
*
* Includes enhancements by Scott Trenda <scott.trenda.net>
* and Kris Kowal <cixar.com/~kris.kowal/>
*
* Accepts a date, a mask, or a date and a mask.
* Returns a formatted version of the given date.
@kim3er
kim3er / editor.css.scss
Last active December 11, 2015 22:18
Place the file below in app/assets/ckeditor/ckeditor/skins/moono in your Rails app to prevent ActiveAdmin from clobbering the default CKEditor 4 skin. Not quite as clear cut as I originally thought. Some of the styles exist in IFRAMEs, so won't need to be wrapped in the ActiveAdmin body tag. I don't have the uncompressed source to hand, so I am …
/*
Copyright (c) 2003-2013, CKSource - Frederico Knabben. All rights reserved.
For licensing, see LICENSE.html or http://ckeditor.com/license
*/
body.active_admin {
.cke_reset{margin:0;padding:0;border:0;background:transparent;text-decoration:none;width:auto;height:auto;vertical-align:baseline;box-sizing:content-box;-moz-box-sizing:content-box;-webkit-box-sizing:content-box}.cke_reset_all,.cke_reset_all *{margin:0;padding:0;border:0;background:transparent;text-decoration:none;width:auto;height:auto;vertical-align:baseline;box-sizing:content-box;-moz-box-sizing:content-box;-webkit-box-sizing:content-box;border-collapse:collapse;font:normal normal normal 12px Arial,Helvetica,Tahoma,Verdana,Sans-Serif;color:#000;text-align:left;white-space:nowrap;cursor:auto}.cke_reset_all .cke_rtl *{text-align:right}.cke_reset_all iframe{vertical-align:inherit}.cke_reset_all textarea{white-space:pre}.cke_reset_all textarea,.cke_reset_all input[type="text"],.cke_reset_all input[type="password"]{cursor:text}.cke_reset_all text