Skip to content

Instantly share code, notes, and snippets.

View dannevang's full-sized avatar

Mathias Dannevang dannevang

View GitHub Profile
@dannevang
dannevang / MODX index.php
Created June 29, 2017 07:49 — forked from christianseel/MODX index.php
MODX index.php with XRouting integrated
<?php
/*
* This file is part of MODX Revolution.
*
* Copyright (c) MODX, LLC. All Rights Reserved.
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
@dannevang
dannevang / .bash_profile
Created April 20, 2017 14:10 — forked from natelandau/.bash_profile
Mac OSX Bash Profile
# ---------------------------------------------------------------------------
#
# Description: This file holds all my BASH configurations and aliases
#
# Sections:
# 1. Environment Configuration
# 2. Make Terminal Better (remapping defaults and adding functionality)
# 3. File and Folder Management
# 4. Searching
# 5. Process Management
@dannevang
dannevang / getPageFeed.php
Created October 11, 2016 09:29 — forked from nick2687/getPageFeed.php
Simple modx snippet that will pull facebook page feed data and display it using a chunk
<?php
// Facebook App id & secret
$fb_app_id = isset($fb_app_id) ? $fb_app_id : NULL;
$fb_app_secret = isset($fb_app_secret) ? $fb_app_secret : NULL;
$access_token = $fb_app_id . '|' . $fb_app_secret;
// Other options
$page_id = isset($page_id) ? $page_id : NULL ;
$chunk = isset($chunk) ? $chunk : 'getPageFeedTpl' ;
@dannevang
dannevang / userisloggedin.snippet.php
Created September 26, 2016 19:38
MODX UserIsLoggedin - Checks whether or not a user is logged in and does something with it
<?php
/**
* UserIsLoggedin
* Checks whether or not a user is logged in or not and does something with it
*
* Examples (top-down):
* [[!UserIsLoggedin? &redirectToOnNotAuthorized=`id-of-page`]]
* OR
* [[!UserIsLoggedin? &sendUnauthorized=`1`]]
* OR
@dannevang
dannevang / gist:6e1c12973667c1861e4a
Created March 21, 2016 12:36 — forked from julesjanssen/gist:1017978
Magento XML productfeed voor Beslist.nl
<?php
/**
*
* @license MIT License
*
*/
// om 't script wat tijd te geven
ini_set("memory_limit","320M");
ini_set("max_execution_time", 240);
@dannevang
dannevang / performance.patch
Created November 20, 2015 16:35 — forked from DimaSoroka/performance.patch
Performance improvement for Magento Patch SUPEE-6788
Index: app/code/core/Mage/Admin/Model/Variable.php
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- app/code/core/Mage/Admin/Model/Variable.php (revision 2bd128c1f190cd9ea63269824f09789199565251)
+++ app/code/core/Mage/Admin/Model/Variable.php (revision )
@@ -30,6 +30,13 @@
class Mage_Admin_Model_Variable extends Mage_Core_Model_Abstract
{
@dannevang
dannevang / secure_install.sh
Last active August 29, 2015 14:18 — forked from Realetive/secure_install.sh
Install script for MODX
#!/bin/bash
##############
echo "
//////////////////////////////////////
// //
// Welcome to MODx autoinstaller. //
// //
//////////////////////////////////////
<html>
<head>
<title>Select styles with CSS only</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<style>
body {
background-color: #fff;
font-family: helvetica, sans-serif;
margin: 4% 10%
}
<?php
/**
* =========================
* defaultTemplateByParentTv
* =========================
*
* Plugin for modX Revolution
* Set default template for children of a ressource
*
* Author:
<?php
/**
* Magento
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License (AFL 3.0)
* that is bundled with this package in the file LICENSE_AFL.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/afl-3.0.php