Skip to content

Instantly share code, notes, and snippets.

View dgrudinin's full-sized avatar
💭
🐈

Dmitry Grudinin dgrudinin

💭
🐈
  • Russian Federation
View GitHub Profile
@thomasfr
thomasfr / mysqld.service
Created July 23, 2014 17:43
mysqld.service file for systemd
[Unit]
Description=MySQL Server
After=syslog.target
After=network.target
[Service]
Type=simple
PermissionsStartOnly=true
ExecStartPre=/bin/mkdir -p /var/run/mysqld
ExecStartPre=/bin/chown mysql:mysql -R /var/run/mysqld
@matthewpoer
matthewpoer / SugarFieldPhone.php
Last active April 17, 2021 19:06
SugarCRM Phone Number Formatting. Store only the phone number integers and use only that in the EditView, but DetailView and ListView show a pretty format like 1 (123) 123-1234. Does not format for Reports.
<?php
// custom/include/SugarFields/Fields/Phone/SugarFieldPhone.php
require_once('include/SugarFields/Fields/Phone/SugarFieldPhone.php');
class CustomSugarFieldPhone extends SugarFieldPhone{
private $replacement_chars = array(' ','-','(',')','x','X','.','+','#','!');
/**
* Remove any special characters to sanitize input, storing only ints
* @see parent::save