Skip to content

Instantly share code, notes, and snippets.

View antoniocosentino's full-sized avatar
:octocat:
Less is more. Nothing is better.

Antonio Cosentino antoniocosentino

:octocat:
Less is more. Nothing is better.
View GitHub Profile
@antoniocosentino
antoniocosentino / git.md
Last active October 17, 2023 09:28 — forked from hofmannsven/README.md
Git Cheat Sheet

git help

General

Initialize Git: git init

Get everything ready to commit:

@antoniocosentino
antoniocosentino / kprint.php
Last active February 1, 2018 12:48
The most simple, stupid and useful PHP function in the world.
<?
function kprint($string){
echo '<pre>';
print_r($string);
echo '</pre>';
}
?>
@antoniocosentino
antoniocosentino / postDispatch.php
Created February 1, 2018 11:19
shopware5/engine/Shopware/Plugins/Local/Frontend/StylaSEO/Controllers/Frontend/Magazin.php if CURL request to SEO API is creating issues replace postDispatch() with this
public function postDispatch(){
$type = $this->_feed_params['type'];
$js_include = StylaUtils::getJsEmbedCode($this->_username, $this->_snippet_url);
$ret = null;
$path = StylaUtils::getCurrentPath($this->_base_dir);
//disabling call to SEO API
//$ret = StylaUtils::getRemoteContent($this->_username, $path, $this->_url_query_params, $this->_source_url);
@antoniocosentino
antoniocosentino / index.tpl
Last active February 2, 2018 09:38
Plugin customization to hide the left sidebar element. This will replace this file: /shopware5/engine/Shopware/Plugins/Local/Frontend/StylaSEO/Views/frontend/magazin/index.tpl
{extends file='parent:frontend/custom/index.tpl'}
{block name='frontend_index_header'}
{include file='frontend/magazin/header.tpl'}
{/block}
{block name="frontend_index_content_left"}
<style>
#gLeft { display:none; }
@antoniocosentino
antoniocosentino / index.tpl
Last active May 3, 2018 09:41
Shopware5 template customization for Dirndltopia (fixes issue with mobile menu shown on desktop). Replace here: /shopware5/engine/Shopware/Plugins/Local/Frontend/StylaSEO/Views/frontend/magazin/index.tpl
{extends file='parent:frontend/custom/index.tpl'}
{block name='frontend_index_header'}
{include file='frontend/magazin/header.tpl'}
{/block}
{* Sidebar left *}
{block name='frontend_index_content_left'}
{$smarty.block.parent}
<style>
//connect to VPN
wg-quick up prod
//turn off
wg-quick down prod
@antoniocosentino
antoniocosentino / styla-embed
Last active November 1, 2018 10:36
Snippets to embed Styla Areas
<!-- embed a single area -->
<div id="stylaMagazine" data-area="fashion"></div>
<script src="https://client-scripts.styla.com/scripts/clients/your-brand.js" async="" type="text/javascript" xml="space"></script>
<!-- end -->
<!-- embed multiple areas in the same page -->
<!-- this goes in <head> -->
<script src="http://client-scripts.styla.com/scripts/clients/your-brand.js" async type="text/javascript"></script>
const map = new Map([[1, 'one'][2, 'two']])
map.forEach(val => {
console.log(val)
}
@mixin fullHeigtWithoutBottomInset {
height: 100vh;
@supports (height: -webkit-fill-available) {
height: -webkit-fill-available;
}
}
@antoniocosentino
antoniocosentino / encrypt.sh
Created October 20, 2022 08:43
Encrypt / Decrypt a file in Mac using open SSL (Mac command line)
# to encrypt
openssl enc -aes-256-cbc -a -salt -in file.txt -out file.enc
# to decrypt
openssl enc -d -aes-256-cbc -a -in file.enc -out file.txt