Skip to content

Instantly share code, notes, and snippets.

Avatar

Richard Kimber kim3er

View GitHub Profile
@kim3er
kim3er / Preferences.sublime-settings
Created Aug 13, 2016
Material Theme Sublime Settings
View Preferences.sublime-settings
{
"Seti_show_group_arrows": true,
"always_show_minimap_viewport": true,
"auto_complete": true,
"auto_complete_commit_on_tab": true,
"bold_folder_labels": true,
"caret_extra_bottom": 3,
"caret_extra_top": 3,
"caret_extra_width": 2,
"color_scheme": "Packages/Material Theme/schemes/Material-Theme.tmTheme",
View Preferences.sublime-settings
{
"Seti_show_group_arrows": true,
"auto_complete": true,
"auto_complete_commit_on_tab": true,
"caret_extra_bottom": 3,
"caret_extra_top": 3,
"caret_extra_width": 2,
"color_scheme": "Packages/Oceanic Next Color Scheme/Oceanic Next.tmTheme",
"copy_with_empty_selection": true,
"ensure_newline_at_eof_on_save": true,
@kim3er
kim3er / .gemrc
Created Aug 1, 2016
iMac Dot Files
View .gemrc
gem: --no-document
install: --no-rdoc --no-ri
update: --no-rdoc --no-ri
@kim3er
kim3er / script
Created Jul 8, 2015
ufw config for Couchbase 3
View script
ufw allow 11211
ufw allow 11210
ufw allow 11209
ufw allow 4369
ufw allow 8091
ufw allow 8092
ufw allow 18091
ufw allow 18092
ufw allow 11214
ufw allow 11215
@kim3er
kim3er / gist:6594588
Last active Jun 12, 2017 — forked from Sigmus/gist:4014642
Example of parallel Mongoose execution.
View gist:6594588
var performers;
performers = {};
async.parallel({
conductor: function(callback) {
return conductor.find({}, function(err, result) {
return callback(err, result);
});
},
@kim3er
kim3er / editor.css.scss
Last active Dec 11, 2015
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 …
View editor.css.scss
/*
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
@kim3er
kim3er / date.format.js
Created Oct 29, 2012
Date Format with IE fix.
View date.format.js
/*
* 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 / rails-ntlm.conf
Created Sep 14, 2012
Virtual Host configuration for Rails with NTLM using mod_auth_sspi. <%= request.env["HTTP_X_FORWARDED_USER"] %> # Gets Username
View rails-ntlm.conf
<VirtualHost *:80>
ServerName cagv11
DocumentRoot "C:/web/testing/public"
ProxyPass / http://localhost:3000/
ProxyPassReverse / http://localhost:3000/
ProxyPreserveHost On
<Proxy *>
AuthName "Iconica"
@kim3er
kim3er / jquery.sum.js
Created Sep 4, 2012
Sum, Max & Min functions in jQuery
View jquery.sum.js
(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 () {
View app.js
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 };