Skip to content

Instantly share code, notes, and snippets.

View merianos's full-sized avatar

Merianos Nikos merianos

View GitHub Profile
@merianos
merianos / pollen.php
Created October 12, 2023 08:00
Convert Pollen CSS to Bricks JSON
<?php
$css = file_get_contents(dirname(__FILE__) . '/pollen.css');
$css = preg_replace(
[
"/\/\*\*[^\/]*\//m", // Remove any comments
"/\:root\s*\{/", // Remove :root {
"/\}/", // Remove trailing }
"/\n\s*\n/m", // Remove any empty lines
"/^\s*/m", // remove empty spaces from the front end of variables
@merianos
merianos / GetPictureFileFullUrl.php
Last active December 3, 2022 06:56
Symfony 5 with FlySystem and Google Cloud Storage
<?php
use App\Entity\VichUploadableEntity;
use Vich\UploaderBundle\Storage\StorageInterface;
class GetPictureFileFullUrl {
private StorageInterface $storage;
public function __construct(StorageInterface $storage) {
@merianos
merianos / OtTaxonomiesMetabox.php
Last active December 3, 2022 06:54
WordPress Taxonomies / Users MetaBox using OptionTree
<?php
/**
* Created by PhpStorm.
* User: merianos
* Date: 6/7/2018
* Time: 8:39 μμ
*/
class OtTaxonomiesMetabox {
@merianos
merianos / style.css
Created May 8, 2018 05:52
Create DL list
/* CSS Code for the DL List in the sidebar of the page: /stoixima-odigos-theoria */
/* 07/May/2018 */
.icon-listed-dl {
display: table;
width: calc( 100% - 10px );
background: #FFF;
padding: 5px;
}
@merianos
merianos / functions.php
Created October 4, 2017 06:19
Custom font family in the Fonts control of the Elementor page builder after the version 1.7.10
// After the Elementor update to 1.7.10, the fonts list has change in the
// control settings from `fonts` to `options`.
//
// Thus for version after 1.7.10 we should use the following code for retrive
// and set the new font families.
$fonts = $controls_registry->get_control( 'font' )->get_settings( 'options' );
// Register here the custom font families
@merianos
merianos / functions.php
Last active August 20, 2023 15:49
Elementor custom fonts in font control
/**
* Responsible to modify the fonts list in the font control.
*/
function modify_controls( $controls_registry ) {
// First we get the fonts setting of the font control
$fonts = $controls_registry->get_control( 'font' )->get_settings( 'fonts' );
// Then we append the custom font family in the list of the fonts we retrieved in the previous step
$new_fonts = array_merge( [ 'Custom Font Family Name' => 'system' ], $fonts );
// Then we set a new list of fonts as the fonts setting of the font control
$controls_registry->get_control( 'font' )->set_settings( 'fonts', $new_fonts );
@merianos
merianos / Debug Log
Created June 19, 2017 09:58
Debug Log
0 info it worked if it ends with ok
1 verbose cli [ '/usr/local/bin/node',
1 verbose cli '/usr/local/bin/npm',
1 verbose cli 'uninstall',
1 verbose cli '-g',
1 verbose cli 'webpack' ]
2 info using npm@5.0.3
3 info using node@v8.0.0
4 verbose npm-session bcc51cdedb9ff1c1
5 silly install loadCurrentTree
@merianos
merianos / click.js
Last active October 20, 2017 11:22
Automatically click the elements in pages
var $checkBoxes = document.querySelectorAll('._1sy');
$checkBoxes.forEach(
function ( item ) {
var $parent = item.parentElement;
var $grandParent = $parent.parentElement;
var $grandGrandParent = $grandParent.parentElement;
var $grandGrandGrandParent = $grandGrandParent.parentElement;
var $grandGrandGrandGrandParent = $grandGrandGrandParent.parentElement;
$grandGrandGrandGrandParent.remove();
@merianos
merianos / index.html
Created January 27, 2017 08:36
Build button with transparent background color with gradient border and rounded corners
<a href="#">
<span></span>
Do Something
</a>
1081: {
"id": 1081
"name": "Argentina: Primera Division"
"category": "Primera Division"
"country": "Argentina"
"date": 1477414809
"matches": [19]
0: {
"id": 2235305
"status": "FT"