Skip to content

Instantly share code, notes, and snippets.

View dannevang's full-sized avatar

Mathias Dannevang dannevang

View GitHub Profile
@dannevang
dannevang / gitify
Last active May 3, 2024 18:27
DDEV modx gitify command
#!/bin/bash
## Description: Run gitify commands through DDEV
## Usage: gitify [flags] [args]
## Example: "ddev gitify extract"
## ExecRaw: true
cd /var/www/html/gitify/
./vendor/bin/gitify $@
@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 / documents.csv
Last active January 30, 2016 14:06
Import documents based on CSV into Extensionsmalls Product File Attachment extension
sku store_id file label description position only_registred_customers
test 0 http://server.com/link-tofile.pdf A Name A description 0 0
@dannevang
dannevang / duplicate-delete.php
Created January 20, 2016 10:52
Script to delete duplicate gallery images from magento. HT: aadil.co
<?php
/*
* DELETE DUPLICATE GALLERY IMAGES
* 1. Edit ln 9 to match your magento install
* 2. Run from terminal: php /{your_path}/duplicate-delete.php
*
*/
include('app/Mage.php');
umask(0);
@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 / checkxml.php
Created June 15, 2015 13:33
Get XML data from file
<?php
/* Demonstration on how to get product data from at XML file
* Mathias Dannevang <mathias@dannevang.org>
*/
//Function to call the XML file
function download_page($path){
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL,$path);
curl_setopt($ch, CURLOPT_FAILONERROR,1);