generated via plantuml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
localeParseFloat(s, locale) { | |
// Get the thousands and decimal separator characters used in the locale. | |
let [,thousandsSeparator,,,,decimalSeparator] = 1111.1.toLocaleString(locale); | |
// Remove thousand separators, and put a point where the decimal separator occurs | |
s = Array.from(s, c => c === thousandsSeparator ? "" | |
: c === decimalSeparator ? "." : c).join(""); | |
// Now it can be parsed | |
return parseFloat(s); | |
} |
Problem:
When uploading svg file with Carrierwave you may get an error:
Failed to manipulate with MiniMagick, maybe it is not an image?
Original Error: `identify /tmp/mini_magick20190222-32759-1g7lnmy.svg` failed with error:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from "react"; | |
import { PropTypes } from "prop-types"; | |
import classNames from "classnames"; | |
import withStyles from "@material-ui/core/styles/withStyles"; | |
import TableCell from "@material-ui/core/TableCell"; | |
import TableSortLabel from "@material-ui/core/TableSortLabel"; | |
import { | |
AutoSizer, | |
Column, | |
SortDirection, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Commands for installing the server library: | |
sudo apt-get install php7.0-imagick | |
sudo apt-get update | |
sudo service apache2 restart | |
Errors: | |
Caught exception: no decode delegate for this image format `' @ error/blob.c/BlobToImage/ | |
use the following, because it might be that you don't have the MIME tyep SVG installed: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo certbot certonly --manual -d *.domain.com -d domain.com --agree-tos --no-bootstrap --manual-public-ip-logging-ok --preferred-challenges dns-01 --server https://acme-v02.api.letsencrypt.org/directory --config-dir /home/ubuntu/ssl/config-dir --work-dir /home/ubuntu/ssl/work-dir --logs-dir /home/ubuntu/ssl/logs-dir | |
More information: | |
https://websiteforstudents.com/setup-lets-encrypt-wildcard-on-ubuntu-20-04-18-04/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
mPDF: Generate PDF from HTML/CSS (Complete Code) | |
*/ | |
require_once( 'mpdf/mpdf.php'); // Include mdpf | |
$stylesheet = file_get_contents('assets/css/pdf.css'); // Get css content | |
$html = '<div id="pdf-content"> | |
Your PDF Content goes here (Text/HTML) | |
</div>'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export default class Link extends React.Component { | |
parseTo(to) { | |
let parser = document.createElement('a'); | |
parser.href = to; | |
return parser; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Add multimedia source | |
echo "deb http://www.deb-multimedia.org wheezy main non-free" >> /etc/apt/sources.list | |
echo "deb-src http://www.deb-multimedia.org wheezy main non-free" >> /etc/apt/sources.list | |
apt-get update | |
apt-get install deb-multimedia-keyring # if this aborts, try again | |
apt-get update | |
# Go to local source directory | |
cd /usr/local/src |