Skip to content

Instantly share code, notes, and snippets.

View silviubogan's full-sized avatar
🎯
Focusing

Silviu Bogan silviubogan

🎯
Focusing
View GitHub Profile
@silviubogan
silviubogan / mapping-without-_all.json
Created January 11, 2021 15:19
Digging related to ES
{
"catalogue_production_habitats": {
"mappings": {
"habitat": {
"properties": {
"approved": {
"type": "boolean"
},
"countries": {
"properties": {
@silviubogan
silviubogan / critical.js
Created December 22, 2020 16:15
Beginning of attempt to write a critical CSS script
const fs = require('fs');
const critical = require('critical');
const bp = 'build/public/static/css';
const cssFiles = fs
.readdirSync(bp)
.filter((x) => !x.endsWith('.map'))
.map((x) => bp + '/' + x);
@silviubogan
silviubogan / my-output.txt
Last active December 22, 2020 12:14
Output of yarn start:prod (both stdout and stderr)
yarn run v1.22.5
$ NODE_ENV=production node build/server.js
/run/media/silviub/T7-Touch/Lucru/Tibi/in-study/voltos/volto22/build/server.js:1
module.exports=function(e){var t={};function a(n){if(t[n])return t[n].exports;var r=t[n]={i:n,l:!1,exports:{}};return e[n].call(r.exports,r,r.exports,a),r.l=!0,r.exports}return a.e=function(){return Promise.resolve()},a.m=e,a.c=t,a.d=function(e,t,n){a.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},a.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},a.t=function(e,t){if(1&t&&(e=a(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(a.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var r in e)a.d(n,r,function(t){return e[t]}.bind(null,r));return n},a.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return a.d(t,"a",t
@silviubogan
silviubogan / plone-error.log
Created December 11, 2020 16:17
Error in Plone container when uploading an image through Paste
Serving on http://0.0.0.0:8080
/plone/buildout-cache/eggs/zope.deprecation-4.4.0-py3.7.egg/zope/deprecation/deprecation.py:88: DeprecationWarning: isDefaultPage is deprecated. Import from Products.CMFPlone.defaultpage instead
name)
/plone/buildout-cache/eggs/ZODB-5.5.1-py3.7.egg/ZODB/blob.py:339: ResourceWarning: unclosed file <_io.FileIO name='/tmp/BUClzvujnpf' mode='rb' closefd=True>
super(BlobFile, self).close()
ResourceWarning: Enable tracemalloc to get the object allocation traceback
2020-12-11 17:12:40,411 ERROR [Zope.SiteErrorLog:22][waitress] ServerException: http://localhost:8085/bise/POST_application_json_
Traceback (innermost last):
Module ZPublisher.WSGIPublisher, line 162, in transaction_pubevents
Module transaction._manager, line 252, in commit
let customColors;
function rebuildCustomColors() {
customColors = [];
if (Array.isArray(settings.plotlyCustomColors)) {
for (const x of settings.plotlyCustomColors) {
customColors.push(x);
}
}
customColors.push({
@silviubogan
silviubogan / SelectWidget.jsx
Created August 27, 2020 16:58
SelectWidget with some small changes to discover the issue
/**
* SelectWidget component.
* @module components/manage/Widgets/SelectWidget
*/
import React, { Component } from 'react';
import PropTypes from 'prop-types';
import { Icon as IconOld } from 'semantic-ui-react';
import { connect } from 'react-redux';
import { compose } from 'redux';
[ 1065.674010] HDMI3: ASoC: hw_params BE failed -22
[ 1065.681570] sof-audio-pci 0000:00:1f.3: ASoC: can't set iDisp3 Pin hw params: -22
[ 1065.681571] iDisp3: ASoC: hw_params BE failed -22
[ 1065.681571] HDMI3: ASoC: hw_params BE failed -22
[ 1065.682050] sof-audio-pci 0000:00:1f.3: ASoC: can't set iDisp3 Pin hw params: -22
[ 1065.682051] iDisp3: ASoC: hw_params BE failed -22
[ 1065.682052] HDMI3: ASoC: hw_params BE failed -22
[ 1065.682328] sof-audio-pci 0000:00:1f.3: ASoC: can't set iDisp3 Pin hw params: -22
[ 1065.682329] iDisp3: ASoC: hw_params BE failed -22
[ 1065.682330] HDMI3: ASoC: hw_params BE failed -22
@silviubogan
silviubogan / functions.php
Created July 5, 2020 17:04
JavaScript + PHP pentru WooCommerce
add_action( 'woocommerce_single_product_summary', 'replace_add_to_cart_btn', 31 );
function replace_add_to_cart_btn() {
?>
<style>.single_add_to_cart_button{display:none}</style>
<script>jQuery(document).ready(function($){
$('.add_to_cart_button').remove();
$(".custom_buy_now_command").on("click", function () {
var x = $("div.quantity > input").val();
if (!x) {
@silviubogan
silviubogan / pdf-dir-page-count.sh
Last active December 27, 2015 07:19
A bash script which prints the total number of pages in all the PDF files under the current directory.
#!/bin/bash
sum=0
while IFS= read -r line ; do
x=$(pdfinfo -meta "$line" | grep Pages | awk '{print $2}')
sum=$(( $sum + $x ))
done < <(find . -type f -name "*.pdf")
echo "There are $sum total pages in all PDF files under the current directory."