Skip to content

Instantly share code, notes, and snippets.

View dgrudinin's full-sized avatar
💭
🐈

Dmitry Grudinin dgrudinin

💭
🐈
  • Russian Federation
View GitHub Profile
@dgrudinin
dgrudinin / mysqld.service
Created March 27, 2016 17:56 — forked from thomasfr/mysqld.service
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
@dgrudinin
dgrudinin / SugarFieldPhone.php
Created February 12, 2016 12:28 — forked from matthewpoer/SugarFieldPhone.php
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