Skip to content

Instantly share code, notes, and snippets.

View alroniks's full-sized avatar

Ivan Klimchuk alroniks

View GitHub Profile
@rtripault
rtripault / checkLexicon.php
Created October 31, 2010 21:55
Check MODx Revolution lexicon files (by Hansek, source : http://modxcms.com/forums/index.php/topic,50565.0.html)
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<!--
Updated for MODx Revo by: Hansek http://www.modxcms.cz/ [email protected]
Created for MODx Evo by : Coroico (http://modx.wangba.fr)
Short Description: Language files checking tool for MODx Revolution
Version: 1.2
Created by: Coroico (http://modx.wangba.fr)
@d3vron
d3vron / mixins.styl
Created July 13, 2011 14:04
Easy-to-use CSS3 mixins for Stylus (includes linear-gradient)
vendor(prop, args)
-webkit-{prop} args
-moz-{prop} args
-ms-{prop} args
-o-{prop} args
{prop} args
border-radius()
vendor('border-radius', arguments)
@Irio
Irio / gist:1496746
Created December 19, 2011 11:24
Solution for "cannot load such file -- openssl" on RVM
When I tried run "rake test", I received:
rake aborted!
cannot load such file -- openssl
Tasks: TOP => test:units => test:prepare => db:test:prepare => db:abort_if_pending_migrations => environment
(See full trace by running task with --trace)
@jgebhardt
jgebhardt / gist:1676679
Created January 25, 2012 15:06
hotfix to manually generate MODx resource URIs from the tree after updating
BEGIN TRANSACTION;
WITH builder AS(
SELECT id , alias , parent, CAST('' AS VARCHAR(765)) [path], 0 [iter], parent [top], CAST('root' AS VARCHAR(300)) [hierarchy]
FROM dbo.modx_site_content parent
UNION ALL
SELECT child.id, child.alias, parent.parent, CAST(path AS VARCHAR(255)) + CAST('/' AS VARCHAR(255)) + CAST(child.alias AS VARCHAR(255)) [path], iter + 1 [iter], child.parent [top], CAST(hierarchy AS VARCHAR(100)) + CAST('/' AS VARCHAR(100)) + CAST(child.id AS VARCHAR(100)) [hierarchy]
@splittingred
splittingred / .htaccess
Created April 9, 2012 21:48
Example of how to use new REST server class in MODX 2.3+
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-s
RewriteRule ^(.*)$ rest/index.php?_rest=$1 [QSA,NC,L]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^(.*)$ rest/index.php [QSA,NC,L]
</IfModule>
@Mark-H
Mark-H / snippet.php
Created May 7, 2012 14:47
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
@begoon
begoon / gist:3252006
Created August 3, 2012 22:08
Русско-английский словарь деловой переписки
  1. Господи, это опять вы.... - Thank you very much for your email.
  2. Если до завтра не предоставите документы, пеняйте на себя. Тут вам не детский сад.- We will do our best to proceed with your request however for the best result the documents should reach us not later than tomorrow.
  3. Вы читать умеете? - You can find this information below.
  4. Сколько можно напоминать!- Kind reminder
  5. Неужели так сложно подписать документ там, где нужно - Please sign in the place marked with yellow sticker
  6. Что у тебя в школе было по математике? - Let's reconfirm the figures.
  7. Мы лучше сделаем это сами.- Thank you for your kind assistance.
  8. Я уже сто раз вам это присылал. - Kindly find attached.
  9. Ага, сейчас все брошу и побегу разбираться. - I’ll look into it and revert soonest.
  10. Да поймите же вы наконец - Please kindly review the matter again.
@valpackett
valpackett / README.md
Created August 18, 2012 14:16
MODX + Monolog

MODX Revolution + Monolog

Replace MODX logging with Monolog to log to Graylog2, syslog, AMQP, etc.

Installation

  • put all the contents of this gist into the document root (where folders core, manager, etc. are located)
  • run composer install to get Monolog
  • run sh patchmodx.sh
  • edit modx-monolog.php - at line 22 there's the default handler - replace it with whatever you want to log to - see monolog readme for more info
@superbrothers
superbrothers / ansi-color.php
Created August 23, 2012 01:49
ANSI color terminal output module for php
<?php
/**
* php-ansi-color
*
* Original
* https://github.com/loopj/commonjs-ansi-color
*
* @code
* <?php
* require_once "ansi-color.php";