Skip to content

Instantly share code, notes, and snippets.

View putzflorian's full-sized avatar

Florian Putz putzflorian

  • @elements-at
  • Salzburg
  • 07:14 (UTC +02:00)
View GitHub Profile
@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 "[email protected]"
# 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">[email protected]<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
*/
@putzflorian
putzflorian / scrollreload.js
Created October 11, 2016 14:14
scroll to reload
if(device.mobile()){
var nearToBottom = 2000;
} else {
var nearToBottom = 1000;
}
$(window).scroll(function () {
if ($(window).scrollTop() + $(window).height() > $(document).height() - nearToBottom) {
relaod();
}
@putzflorian
putzflorian / viewinstanz.php
Last active June 8, 2016 11:24
view instanz im helper
<?php
$viewRenderer = \Zend_Controller_Action_HelperBroker::getExistingHelper("viewRenderer");
$view = $viewRenderer->view;
$link = $view->url(array(
"language" => $language,
"name" => $obj->getTitle(),
"id" => $obj->getAlpsteinid()
),
@putzflorian
putzflorian / sqluser.txt
Created June 2, 2016 06:18
sqluser change
mysqldump -uuser1 -ppassword1 database1 > backup.sql
sed '/^\/\*\!50013 DEFINER/d' backup.sql > backup_without_50013.sql
mysql -u user2 -ppassword2 -D database2 < backup_without_50013.sql
@putzflorian
putzflorian / timeselct.html
Created May 17, 2016 13:19
time select every 15 mins
<select class="form-control" name="uhrzeit" id="uhrzeit">
<option value="00:00">00:00</option>
<option value="00:15">00:15</option>
<option value="00:30">00:30</option>
<option value="00:45">00:45</option>
<option value="01:00">01:00</option>
<option value="01:15">01:15</option>
<option value="01:30">01:30</option>
<option value="01:45">01:45</option>
<option value="02:00">02:00</option>