Skip to content

Instantly share code, notes, and snippets.

View christianhanvey's full-sized avatar

Christian Hanvey christianhanvey

View GitHub Profile
@christianhanvey
christianhanvey / links
Created July 24, 2012 00:17
some useful reference links - in markdown
@christianhanvey
christianhanvey / modx object examiner
Created July 22, 2012 11:25
modx revo object debug helper snippet
<?php
/**
* File viewRevoObjects.php (requires MODx Revolution 2.1)
* Created on: 9/17/11 at 9:49 AM
* Project shawn_wilkerson
* @elements
* @version 1.0
* @category
* @author W. Shawn Wilkerson
@christianhanvey
christianhanvey / snippet.md
Created July 2, 2012 02:02 — forked from harthur/snippet.md
console.log() key binding for Sublime Text

Go to Sublime Text 2 > Preferences > Key Bindings - User and add this JSON to the file:

[
    { "keys": ["super+shift+l"],
      "command": "insert_snippet",
      "args": {
        "contents": "console.log(${1:}$SELECTION);${0}"
      }, "context":
 [
@christianhanvey
christianhanvey / convertMarkdown.php
Created June 21, 2012 13:20
convert from Markdown to HTML - MODX custom output filter
<?php
/* convertMarkdown - a custom output filter
* by Christian Hanvey
* WTFPL License
*
* ORIGINAL PHP MARKDOWN CLASS by Michel Fortin
* http://michelf.com/projects/php-markdown/
*
*
@christianhanvey
christianhanvey / snippet.php
Created June 4, 2012 00:08 — forked from Mark-H/snippet.php
MODX Snippet to take a database backup and to email that.
<?php
$mailto = (isset($mailto)) ? $mailto : '@@ DEFAULT EMAIL HERE @@';
$warningMail = '@@ EMAIL TO SEND WARNING TO IN CASE OF A SMALL BACKUP FILE @@';
include MODX_CORE_PATH.'/config/'.MODX_CONFIG_KEY.'.inc.php';
$host = $database_server; // database host
$dbuser = $database_user; // database user name
$dbpswd = $database_password; // database password
$mysqldb = $dbase; // name of database
@christianhanvey
christianhanvey / modx-snippets.php
Last active December 8, 2024 18:46
Useful snippets for MODX Revo
Snippet: [[SnippetName]]
Chunk: [[$ChunkName]]
System Setting: [[++SettingName]]
TV: [[*fieldName/TvName]]
Link tag: [[~PageId? &paramName=`value`]]
Placeholder: [[+PlaceholderName]]
<?php
@christianhanvey
christianhanvey / gist:2768300
Created May 22, 2012 10:51
Update resource fields on save (MODX Revo 2.2)
<?php
/*
Update resource fields when they are saved
trigger on the following system events:
OnBeforeDocFormSave
OnDocFormSave
note: changing / inserting tv values is better done onDocFormSave as the process for saving tvs onBeforeDocFormSave is much more complicated (apparently)
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Compass Flag/Ribbon Mixins &middot; CodePen</title>
<style>
@christianhanvey
christianhanvey / Fullpage.html
Created May 16, 2012 08:18
Green Corner Ribbon
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Green Corner Ribbon &middot; CodePen</title>
<style>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Matt Hamm's Page Curl Boxes &middot; CodePen</title>
<link rel="stylesheet" href="http://codepen.io/stylesheets/css/reset.css">