Skip to content

Instantly share code, notes, and snippets.

@cukabeka
cukabeka / postsave.php
Last active March 31, 2017 20:59
Redaxo Modul ACTION Sync Metadaten / Artikel
<?php
$values = rex_request('VALUE');
$REX_ACTION['VALUE'][13] = "|".implode ("|",$values[13])."|";
$REX_ACTION['VALUE'][14] = "|".implode ("|",$values[14])."|";
$sql = rex_sql::factory();
$sql->setTable($REX['TABLE_PREFIX'].'article');
$sql->setValue('art_tag', $REX_ACTION['VALUE'][13]);
$sql->setWhere('id = '.intval($REX['ARTICLE_ID']));
@cukabeka
cukabeka / 1und1.php
Last active October 7, 2015 09:28
CRONJOB Komplettbackup
<?php
// http://hilfe-center.1und1.de/hosting/scripte_datenbanken/datenbanken/5.html
global $REX;
$host = $REX['DB']['1']['HOST'];
$db = $REX['DB']['1']['NAME'];
$dbuser = $REX['DB']['1']['LOGIN'];
$dbpw = $REX['DB']['1']['PSW'];
<?php
/**
*=============================================
* REDAXO-Modul: do form!
* Bereich: Eingabe
* Version: 4.5 ajax
* Redaxo Version: 4.3
* Module-id: 364
* Thomas Skerbis / www.klxm.de
* Hinweise:
<?php
# Linear connection info for connecting to FTP
# set up basic connection
$ftp_server = "ftp.yourserver.com";
$ftp_user = "Username";
$ftp_pass = "Password";
$ftp_conn = ftp_connect($ftp_server);
$ftp_login = ftp_login($ftp_conn, $ftp_user, $ftp_pass);
<?php
// -------------------------------------------------------------
// The following functions are used to detextile html, a process
// still in development.
// By Tim Koschützki
// Based on code from www.aquarionics.com
// -------------------------------------------------------------
class html2textile {
function detextile($text) {
$text = preg_replace("/(<\/?)(\w+)([^>]*>)/e", "'\\1'.strtolower('\\2').'\\3'", $text);
/*
http://designshack.net/articles/css/10-less-css-examples-you-should-steal-for-your-projects/
Mixin
*/
@base: #663333;
@complement1: spin(@base, 180);
@complement2: darken(spin(@base, 180), 5%);
@lighten1: lighten(@base, 15%);
.text-shadow (@string: 0 1px 3px rgba(0, 0, 0, 0.25)) {
text-shadow: @string;
}
.box-shadow (@string) {
-webkit-box-shadow: @string;
-moz-box-shadow: @string;
box-shadow: @string;
}
.drop-shadow (@x: 0, @y: 1px, @blur: 2px, @spread: 0, @alpha: 0.25) {
-webkit-box-shadow: @x @y @blur @spread rgba(0, 0, 0, @alpha);
@cukabeka
cukabeka / Immobilienscout24-REST-API-Felder.csv
Last active December 26, 2015 02:49
German translations of IS24-REST-API Output as CSV
ROOF_STOREY Dachgeschoss
LOFT Loft
MAISONETTE Maisonette
PENTHOUSE Penthouse
TERRACED_FLAT Terrassenwohnung
GROUND_FLOOR Erdgeschosswohnung
APARTMENT Etagenwohnung
RAISED_GROUND_FLOOR Hochparterre
HALF_BASEMENT Souterrain
OTHER Sonstige
@cukabeka
cukabeka / 0.9.less
Created November 8, 2013 17:23
less elements
/*---------------------------------------------------
LESS Elements 0.9
---------------------------------------------------
A set of useful LESS mixins
More info at: http://lesselements.com
---------------------------------------------------*/
.gradient(@color: #F5F5F5, @start: #EEE, @stop: #FFF) {
background: @color;
background: -webkit-gradient(linear,
@cukabeka
cukabeka / config.php
Created December 12, 2013 22:32
If we want to use different database credentials for the local development server and the online production or staging server, we can modify the database settings in the wp_config file http://blog.g-design.net/post/60019471157/managing-and-deploying-wordpress-with-git
if ($_SERVER['REMOTE_ADDR']=='127.0.0.1') {
define('WP_ENV', 'development');
} else {
define('WP_ENV', 'production');
}
// MySQL settings - You can get this info from your web host //
if (WP_ENV == 'development') {
define('DB_NAME', 'mydb-dev');
define('DB_USER', 'root');