Skip to content

Instantly share code, notes, and snippets.

View DarkMukke's full-sized avatar

Mukke DarkMukke

View GitHub Profile
@DarkMukke
DarkMukke / gist:4125716
Created November 21, 2012 16:10
Load config file in Yii modules
class BlehModule
{
public __construct()
{
$conf = include "thefile.php";
$this->config($conf);
}
@DarkMukke
DarkMukke / gist:4127528
Created November 21, 2012 20:42
Sub layouts in Yii
#file : overall.php
<html>
<head> <title> stuff </title> </head>
<body>
<header>
this is my header
</header>
<?php echo $content; ?>
#!/usr/bin/env bash
#
# # # example.ini
# [goedhuis-dev]
# USER = juno
# HOST = gh.juno.is
#
# [goedhuis-stag]
# USER = juno
config="app/etc/local.xml"; u=`sed -n 's/.*<username><!\[CDATA\[\(.*\)]]><\/username>/\1/p' $config`;n=`sed -n 's/.*<dbname><!\[CDATA\[\(.*\)]]><\/dbname>/\1/p' $config`;p=`sed -n 's/.*<password><!\[CDATA\[\(.*\)]]><\/password>/\1/p' $config`;mysqldump -u $u -p"${p}" $n > ~/${n}_$(date +"%Y_%m_%d")
<?php
/**
* @license MIT
* @author Ruben Decleyn mukke@tbs-dev.co.uk>
* @created 12/02/2017
*/
namespace App\TwigExtensions;
probably the same amount of components, just simple
Also you could display the hours and minutes on 2 different displays
;; I have used long variable names to reduce confusion,
;; daylightSensorDegrees integer (0 -> 180 and back after midnight)
;; daylightSensorVisible integer ( 0 || 1)