Skip to content

Instantly share code, notes, and snippets.

View putzflorian's full-sized avatar

Florian Putz putzflorian

  • @elements-at
  • Salzburg
  • 21:12 (UTC +01:00)
View GitHub Profile
@putzflorian
putzflorian / Helper.php
Last active April 3, 2024 13:45
Website_Tool_Helper
<?php
class Website_Tool_Helper
{
public static function getImageTitle($image, $language)
{
$key = 'bild_title_' . $language;
@putzflorian
putzflorian / regex.txt
Last active January 6, 2023 14:46
Migrate Php templates to Twig for Pimcore X
__PARTS__
Methods (required!!!)
((?:render|extends|include)\s*\(?\s*(?:'|")):?
Level
(?:((?:\w|-|_)+)(?::|\/))
Last Level (required!!!)
(?:((?:\w|-|_)+)(?::|\/)?)
<?php
/**
* @return resource
*/
public function getStream()
{
if ($this->stream) {
if(get_resource_type($this->stream) != "stream"){
1. Make Home Directory for SShH keys.
c://users/UserName/.SSH (for Windows 7)
2. Generate SSH key by command:
ssh-keygen -t rsa -C "user@mail.ru"
# Creates a new ssh key, using the provided email as a label
Generating public/private rsa key pair.
It's created a pair of keys - private and public in home dir .SSH
C:\Users\SuvorovAG\.ssh\id_rsa
<?php
$actual_hour = date('H');
$condition[] = 'hour_' . $actual_hour;
$lifetime = 3600; // 1h
$mdCondition = md5($condition);
if (!Cache::load($mdCondition)) {
$objects->setOrderKey("RAND($actual_hour)", false);
Cache::save(
$objects,
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p><strong><span style="font-size:18px"><span style="color:#009fe3"><span style="font-family:Lucida Sans Unicode,Lucida Grande,sans-serif">Noyoco</span></span></span></strong></p>
<p><span style="font-size:16px"><span style="font-family:Lucida Sans Unicode,Lucida Grande,sans-serif"><a href="tel:+43 664 9183517" style="color:#af6983"><span style="color:#e5007d">+43 664 9183517</span></a><br />
<span style="color:#e5007d">music@noyoco.org<br />
@putzflorian
putzflorian / openssl_encrypt_decrypt.php
Created May 29, 2018 08:44 — forked from joashp/openssl_encrypt_decrypt.php
Simple PHP encrypt and decrypt using OpenSSL
<?php
/**
* simple method to encrypt or decrypt a plain text string
* initialization vector(IV) has to be the same when encrypting and decrypting
*
* @param string $action: can be 'encrypt' or 'decrypt'
* @param string $string: string to encrypt or decrypt
*
* @return string
*/
<?php
$page = $this->_getParam("page");
$per_page = 5;
$paginator = Zend_Paginator::factory($events);
$paginator->setCurrentPageNumber($page);
$paginator->setPageRange(5);
$paginator->setItemCountPerPage($per_page);
$this->view->paginator = $paginator;
@putzflorian
putzflorian / Zend_View_Helper.php
Last active February 10, 2017 19:08
Zend_View_Helper
<?php
$this->getRequest()->getPost('id', null);
$this->headScript()->appendFile('/static/js/parsley.js','text/javascript');
$this->headLink()->appendStylesheet('/static/css/themenuebersicht.css');
// get snippet path
$this->snippet("xyz")->getSnippet()->getFullPath()
@putzflorian
putzflorian / Object.keys.js
Created August 19, 2013 11:40
Object.keys for IE8
Object.keys = Object.keys || (function () {
var hasOwnProperty = Object.prototype.hasOwnProperty,
hasDontEnumBug = !{toString:null}.propertyIsEnumerable("toString"),
DontEnums = [
'toString',
'toLocaleString',
'valueOf',
'hasOwnProperty',
'isPrototypeOf',
'propertyIsEnumerable',