Skip to content

Instantly share code, notes, and snippets.

@ipimpat
ipimpat / details.php
Last active June 22, 2016 18:38
Simple PyroCMS module (event) that sets the language based on first uri segment, so that content stored under e.g. /da will make PyroCMS (CI) run as "danish". Create a folder in any "module" directory named i18n and add these files, and install module using the admin panel
<?php
defined('BASEPATH') or exit('No direct script access allowed');
/**
* i18n details file
*
* @author Kim Henriksen <kh@ipimp.at>
* @package PyroCMS
* @subpackage i18n Module
@ipimpat
ipimpat / mbox_get_unseen_messages.php
Last active August 29, 2015 14:01
Returns array of bodies of UNSEEN email message
<?php
/**
* Returns array of bodies of UNSEEN email message
* @param mixed $mbox array of mailbox, username and password OR mailbox opened with imap_open();
* @param string $sender optional: get only messages from $sender email address
*/
function mbox_get_unseen_messages($mbox, $sender = NULL)
{
// Email bodies
@ipimpat
ipimpat / spigotmc-install.sh
Last active August 29, 2015 14:21
Spigotmc Ubuntu Installation Script (tested on Ubuntu 14.04)
echo '+------------------------------------------------------------------------+'
echo ' Spigotmc installation script for Ubuntu based Linux distros'
echo -e '\n'
echo ' Copyright © 2015 Kim Henriksen'
echo -e '\n'
echo ' All rights reserved, use this script at your own risk'
echo '+------------------------------------------------------------------------+'
# Installation parameters
DOWNLOAD_URL=https://hub.spigotmc.org/jenkins/job/BuildTools/lastSuccessfulBuild/artifact/target/BuildTools.jar
<?php
/*
*
* The MIT License (MIT)
*
* Copyright (c) 2015 Kim Henriksen
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
<?php
// Include database connection
include 'connect.php';
// Declare result array
$result = array(
'nameA' => ' Temperatur',
'nameB' => ' Setpoint',
'category' => array(),
'data1' => array(),