Skip to content

Instantly share code, notes, and snippets.

@mkay
mkay / check-all.js
Created February 4, 2014 11:10
toggle check-all checkboxes
$(function(){
$('#checkAll').live('change', function(){
var isChecked = !$('.checkbox').prop('checked');
if($(this).is(':checked')){
$('.checkbox').prop('checked', isChecked);
} else {
$('.checkbox').removeAttr('checked');
}
});
@mkay
mkay / monokai.css
Last active August 29, 2015 13:56
MODX CodeMirror Theme: idlefingers
/*
I admit I cba to figure out howto add a new theme to MODX Codemirror. :)
So for now: just edit the monokai theme in /assets/components/codemirror/cm/theme/monokai.css and select it in the plugin's prefs.
Don't forget to clear the cache.
*/
.cm-s-monokai { font-family: Monaco, Menlo,"Andale Mono","lucida console","Courier New",monospace !important; font-size:.85em !important; }
.cm-s-monokai { background: #393939; color: #ccc; }
.cm-s-monokai .CodeMirror-selected { background: #000 !important; color: #efefef; }
.cm-s-monokai .CodeMirror-searching { background: #2A543A !important; }
.cm-s-monokai .CodeMirror-gutter { background: #333333; border-right: 0px; }
@mkay
mkay / update-modx.sh
Created March 8, 2014 22:57
MODX CLI updater
#!/bin/bash
########################################################
#
# MODX (modx.com) CLI updater
# Kreuder 20140308 mk@s1.gl
#
########################################################
#
# Description: perform a MODX Basic Upgrade via CLI.
#
@mkay
mkay / owncloud.conf
Created March 26, 2014 18:07
example ownCloud config for nginx
# owncloud.example.com:80
server {
listen 0.0.0.0:80;
server_name owncloud.example.com;
rewrite ^ https://$server_name$request_uri? permanent;
}
# owncloud.example.com:443
@mkay
mkay / ckeditor.format_tags
Last active August 29, 2015 14:13
a basic, slim CKEditor config for MODX Revolution
p;h1;h2;h3;h4
@mkay
mkay / debug
Created February 3, 2015 09:29
Bootstrap visual debug snippet
<!-- DEBUG -->
<div style="position: fixed; z-index:999">
<span class="label label-success hidden-xs hidden-sm hidden-md">LG</span>
<span class="label label-info hidden-xs hidden-sm hidden-lg">MD</span>
<span class="label label-primary hidden-xs hidden-md hidden-lg">SM</span>
<span class="label label-warning hidden-sm hidden-md hidden-lg">XS</span>
</div>
<!-- /DEBUG -->
<?php
if($modx->context->get('key') != "mgr"){
/* grab the current langauge from the cultureKey request var */
switch ($_REQUEST['cultureKey']) {
case 'en':
/* switch the context */
$modx->switchContext('en');
break;
default:
/* Set the default context here */
<?php
/*
getTVLabel snippet for modx 2.3
Version:
------------------
v0.0.1 (2015-03-06 16:44)
Author:
------------------
@mkay
mkay / create_project.sh
Last active September 6, 2015 12:38
Alfred Workflow for creating SASS/COMPASS projects
#!/bin/bash
#
# =================
# = What is this? =
# =================
# This is an Alfred (https://www.alfredapp.com/) workflow that will create a structured SASS/COMPASS project:
# (your mileage will vary and you will need to adjust the paths and actions)
# {query} = the string/name your entered in your Alfred dialog
#
# example.com (yes, I sort them by domain names)
@mkay
mkay / nginx.conf
Last active October 6, 2015 08:31
MODX Babel rewrites for nginx
server {
location / {
# MODX babel rewrites
rewrite ^/(en|de)/css(.*)$ /css$2 break;
rewrite ^/(en|de)/js(.*)$ /js$2 break;
rewrite ^/(en|de)/img(.*)$ /img$2 break;