Skip to content

Instantly share code, notes, and snippets.

View christianhanvey's full-sized avatar

Christian Hanvey christianhanvey

View GitHub Profile
@christianhanvey
christianhanvey / imgtag.html
Created January 24, 2012 09:48 — forked from anselmh/imgtag.html
The New Img Tag (evolved)
<img src="large-default-file.jpg" alt="default alt text describing image" title="default title text">
<source src="smaller.jpg" media="screen and (max-device-width:600px)" alt="this is alternative text for smaller file" title="this is title for smaller file">
<source src="tiny.jpg" media="screen and (max-device-width:320px)" alt="this is alternative text for tiny file" title="this is title for tiny file">
<source src="monochrome.jpg" media="monochrome" alt="this is alternative text for monochrome file" title="this is title for monochrome file">
</img>
<!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">
@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>Compass Flag/Ribbon Mixins &middot; CodePen</title>
<style>
@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)
@christianhanvey
christianhanvey / modx-snippets.php
Last active June 14, 2023 13:02
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 / 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 / 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.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 / 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