Skip to content

Instantly share code, notes, and snippets.

GDmac GDmac

  • Netherlands
Block or report user

Report or block GDmac

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@GDmac
GDmac / patch_commit_52e32c475952.patch
Last active Dec 28, 2015
CI merge cache, QB/AR no escape
View patch_commit_52e32c475952.patch
diff --git a/system/database/DB_query_builder.php b/system/database/DB_query_builder.php
index f0fe96c35622a77066952d6a23fc526044590df7..d912540b5e2cd825b705088bee2497ba72fd04aa 100644
--- a/system/database/DB_query_builder.php
+++ b/system/database/DB_query_builder.php
@@ -2561,14 +2561,30 @@ abstract class CI_DB_query_builder extends CI_DB_driver {
{
$qb_variable = 'qb_'.$val;
$qb_cache_var = 'qb_cache_'.$val;
- $qb_new = $this->$qb_cache_var;
-
@GDmac
GDmac / _readme.md
Last active Dec 24, 2015
ExpressionEngine Core_member add-on
View _readme.md

Core_member

an ExpressioneEngine add-on

Core Member is a Mash-up of the old Freemember plugin and cp-login code. This add-on was developed for a hobby-group website that uses EE-Core and to allow member-only templates and members-only content.

Members can be added and edited in the control panel, by the admin. This plugin provides only some very basic member functionality like: login, logout, forgot password, reset password and change password.

View create_rss_feed_recursive.php
<?php
$xml = new SimpleXMLElement(
'<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:media="http://search.yahoo.com/mrss/">
<channel>
</channel>
</rss>');
View relative_dates.php
<?php
echo '<PRE>';
$t = "friday 10am";
$x = strtotime($t);
if ( $x < time() )
{
$x = strtotime('next ' . $t);
}
@GDmac
GDmac / reverse_related_stash_list.html
Last active Dec 16, 2015
Stash list reverse related
View reverse_related_stash_list.html
@GDmac
GDmac / forge01.php
Created Nov 11, 2012
CI 3.dev DB-Forge
View forge01.php
<?php
class Welcome2 extends CI_Controller {
public function forge()
{
$this->output->enable_profiler(TRUE);
$this->load->database();
$this->load->dbforge();
@GDmac
GDmac / pi.test_plugin.php
Created Sep 27, 2012
test_plugin for conditionals
View pi.test_plugin.php
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
$plugin_info = array(
'pi_name' => 'Test_plugin',
'pi_version' => '1.0',
'pi_author' => 'GDmac',
'pi_author_url' => '',
'pi_description' => 'Testing stuff',
'pi_usage' => Test_plugin::usage()
);
@GDmac
GDmac / matchparser.php
Created Sep 25, 2012
LOCO parser library MatchParser
View matchparser.php
<?php
class MatchParser extends MonoParser {
private $first;
private $second;
public function __construct($internals, $first, $second, $callback = null) {
if($internals[$first] !== $internals[$second]) {
throw new GrammarException("Can't create a ".get_class()." first and second should be the same type");
}
@GDmac
GDmac / gist:3694530
Created Sep 10, 2012
Codigniter and MySQL GET_LOCK
View gist:3694530
<?php
/*
- codeigniter, by default, uses persistent database connections, this is problematic in that the
lock is never automatically released on connection termination (what else is to expect with persistent
connections). However after a script ends you also never can RELEASE_LOCK() anymore, at least it didn't
work overhere while testing. The script really has to make sure to release the lock before ending
(shutdown_function) if it uses persistent DB connections.
@GDmac
GDmac / gist:3667859
Created Sep 7, 2012
EE Preload replace double trick
View gist:3667859

main template

{preload_replace:preload_trick="preload_replace"}
{embed="group/template" preload='{{preload_trick}:pre_url_title="special"}'}

embedded template

if called via embed you can override the preload_replace once more.
It will insert the embed-variable and parse it early.

{embed:preload}
{if segment_3==""}{preload_replace:pre_url_title="fallback"}{/if}

You can’t perform that action at this time.