Skip to content

Instantly share code, notes, and snippets.

View TimWolla's full-sized avatar

Tim Düsterhus TimWolla

View GitHub Profile
<?php
// wcf imports
require_once(WCF_DIR.'lib/data/user/User.class.php');
require_once(WCF_DIR.'lib/data/user/option/UserOptionOutput.class.php');
require_once(WCF_DIR.'lib/data/user/option/UserOptionOutputContactInformation.class.php');
/**
* UserOptionOutputDeviantart is an implementation of UserOptionOutput for the output of a user deviantart account.
*
* @author Sascha Ehrler
<?php
// wcf imports
require_once(WCF_DIR.'lib/data/user/User.class.php');
require_once(WCF_DIR.'lib/data/user/option/UserOptionOutput.class.php');
require_once(WCF_DIR.'lib/data/user/option/UserOptionOutputContactInformation.class.php');
/**
* UserOptionOutputEmail is an implementation of UserOptionOutput for the output of a user email.
*
* @author Marcel Werk
#main {
border: 1px solid red;
margin: 5px;
}
#main > div {
flex-direction: row;
display: flex;
height: 500px;
}
#content, aside {
Smarty3 vs Twig vs Cytro
Generate templates... Done
Testing a lot output...
smarty3: !compiled and !loaded 8.6070 sec, 14.8 MiB
smarty3: compiled and !loaded 0.0434 sec, 7.8 MiB
smarty3: compiled and loaded 0.0058 sec, 7.8 MiB
twig: !compiled and !loaded 4.2420 sec, 67.2 MiB
twig: compiled and !loaded 0.0927 sec, 16.0 MiB
swap = ->
inputVar = parseInt document.getElementById('userInput').value
return undefined unless inputVar?
output.innerHTML = ''
inputVar *= -1 if inputVar < 0
copy = inputVar
count = 1
$sql = "UPDATE wcf".WCF_N."_page_menu_item
SET isLandingPage = 0";
$statement = WCF::getDB()->prepareStatement($sql);
$statement->execute();
$sql = "SELECT menuItemID
FROM wcf".WCF_N."_page_menu_item
WHERE menuPosition = ?
AND parentMenuItem = ?
AND menuItemController <> ?
@TimWolla
TimWolla / dabblet.css
Created March 22, 2013 14:25
The first commented line is your dabblet’s title
/**
* The first commented line is your dabblet’s title
*/
@media (max-width: 480px) {
#content:before {content: "width <= 480"; }
}
@media (max-device-width: 480px) {
#content2:before {content: "device-width <= 480"; }
}
#!/usr/bin/php
<?php
$type = $argv[1];
echo "Forcing map-save\n";
exec("screen -p 0 -S ".$type." -X eval 'stuff \"save-off\"\015'");
exec("screen -p 0 -S ".$type." -X eval 'stuff \"save-all\"\015'");
exec("screen -p 0 -S ".$type." -X eval 'stuff \"say Backup gestartet\"\015'");
$time = time();
echo "Creating backup /home/minecraft/BACKUP/".$type."/world_".date('Y.m.d_H:i:s', $time).".tar.gz\n";
exec('cd /home/minecraft/'.$type.' && tar -czvf /home/minecraft/BACKUP/'.$type.'/world_'.date('Y.m.d_H:i:s', $time).'.tar.gz world_new world_new_nether plugins --exclude dynmap', $output);
@TimWolla
TimWolla / month.php
Created February 3, 2013 12:09
Easily find out timestamp of first and last second of last month in PHP.
<?php
$start = strtotime('first day of last Month 00:00:00');
$end = strtotime('last day of last month 23:59:59');
@TimWolla
TimWolla / icon.less
Last active December 11, 2015 19:28
@font-face {
font-family: 'FontAwesome';
src: url('../font/fontawesome-webfont.eot?v=3.0.1');
src: url('../font/fontawesome-webfont.eot?#iefix&v=3.0.1') format('embedded-opentype'),
url('../font/fontawesome-webfont.woff?v=3.0.1') format('woff'),
url('../font/fontawesome-webfont.ttf?v=3.0.1') format('truetype');
font-weight: normal;
font-style: normal;
}