Skip to content

Instantly share code, notes, and snippets.

@michael-e
michael-e / event.event1.php
Created October 29, 2018 11:48 — forked from wdebusschere/event.event1.php
Custom event1
<?php
class eventevent1 extends SectionEvent
{
public $ROOTELEMENT = 'event1';
public $eParamFILTERS = array(
);
public static function about()
<?php
/**
* Extension driver
*
* @package Lalala
* @author Michael E.
*/
class extension_lalala extends Extension
{
<?php
require_once(EXTENSIONS . '/remote_datasource/data-sources/datasource.remote.php');
Class datasourcetwitter extends RemoteDatasource {
public $dsParamROOTELEMENT = 'twitter';
public $dsParamURL = 'https://api.twitter.com/1.1/statuses/user_timeline.json?include_entities=true&include_rts=true&screen_name=ACCOUNT_NAME&count=10';
public $dsParamFORMAT = 'json';
public $dsParamXPATH = '/';
server {
listen 80;
server_name localhost;
access_log /path/to/log/access.log;
error_log /path/to/log/error.log;
location / {
root /path/to/root;
index index.php;
/*-------------------------------------------------------------------------
Role Manager: (replace in members/extension.driver.php when using Abffilter)
-------------------------------------------------------------------------*/
public function checkFrontendPagePermissions($context) {
$isLoggedIn = false;
$errors = array();
// Checks $_REQUEST to see if a Member Action has been requested,
// member-action['login'] and member-action['logout']/?member-action=logout
@michael-e
michael-e / mysql-alter-tables.php
Last active July 11, 2020 09:59
Loop over all tables of a MySQL database and convert them to `utf8` character set. Also make them use `utf8_unicode_ci` collation. You are encouraged to use the PHP CLI (i.e. run the script from the command line), simply because it may take a while. (On the webserver the script may timeout.)
<?php
// configuration
mysql_connect("host","username","password");
mysql_select_db("database");
// do it
$resource = mysql_query("SHOW TABLES");
while ($row = mysql_fetch_array($resource)) {
$table = $row[0];
@michael-e
michael-e / class.general.php
Created November 21, 2012 09:53
Symphony 1.7.0.1 /symphony/lib/core/class.general.php
<?php
###
#
# Symphony web publishing system
#
# Copyright 2004 - 2006 Twenty One Degrees Pty. Ltd. This code cannot be
# modified or redistributed without permission.
#
# For terms of use please visit http://21degrees.com.au/products/symphony/terms/
@michael-e
michael-e / gist:2352730
Created April 10, 2012 16:41 — forked from panicsteve/gist:1641705
Form letter template for acquired startups
Dear soon-to-be-former user,
We've got some fantastic news! Well, it's great news for us anyway. You, on
the other hand, are fucked.
We've just been acquired by:
[ ] Facebook
[ ] Google
[ ] Twitter
@michael-e
michael-e / Example
Created April 7, 2012 18:39 — forked from designermonkey/Example
Wildcard Subdomains
# Define specified subdomains first
<VirtualHost *:80>
ServerName subdomain.domain.com
DocumentRoot "/path/to/domain.com/subdomains/subdomain"
</VirtualHost>
# Define domain and wildcard subdomains second
<VirtualHost *:80>
ServerName domain.com
DocumentRoot "/path/to/domain.com/httpdocs"
<?xml version="1.0" encoding="UTF-8"?>
<html>
<head>
<link rel="stylesheet" href="workspace/assets/style.css"/>
</head>
<body>
<div id="head">
<h1>Title</h1>
</div>
<div id="package">