This file contains hidden or 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
Number.prototype.formatMoney = function(c, d, t){ | |
c = isNaN(c = Math.abs(c)) ? 2 : c; | |
d = d == undefined ? "." : d; | |
t = t == undefined ? "," : t; | |
var n = this; | |
var s = n < 0 ? "-" : ""; | |
var i = String(parseInt(n = Math.abs(Number(n) || 0).toFixed(c))); | |
var j = (j = i.length) > 3 ? j % 3 : 0; | |
return s + (j ? i.substr(0, j) + t : "") + i.substr(j).replace(/(\d{3})(?=\d)/g, "$1" + t) + (c ? d + Math.abs(n - i).toFixed(c).slice(2) : ""); |
This file contains hidden or 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
<!DOCTYPE html> | |
<html> | |
<style type="text/css"> | |
body { | |
font-size: 18px; | |
background: #000; | |
color: #fff; | |
} | |
#container { | |
width: 600px; |
This file contains hidden or 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
OSTicket API Key | |
How to completely disable IP validation | |
======================================== | |
Open the file /include/class.api.php | |
The solution is to remove the three references to: $_SERVER['REMOTE_ADDR'] | |
That then completely disables any IP validation however the API key will still be validated. | |
You will still need to attach an IP to the API key in the admin panel - just use 99.99.99.99 |
This file contains hidden or 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
breakpoints({ | |
wide: [ '1281px', '1680px' ], | |
normal: [ '961px', '1280px' ], | |
narrow: [ '841px', '960px' ], | |
narrower: [ '737px', '840px' ], | |
mobile: [ null, '736px' ] | |
}); |
This file contains hidden or 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
$.fn.validMKPhone = function() { | |
// https://regex101.com/r/GelZQf/1 | |
let $input = $(this); | |
let mk_phone_regexp = new RegExp(/[0][237][0-9]{0,1}[\-\ ]\d{3,4}[\-\ ]\d{3}/); | |
return mk_phone_regexp.test($input.val()); | |
} |
This file contains hidden or 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
aw=`xdotool getactivewindow`;xdotool search --name '10.' windowactivate key ctrl+r;xdotool windowactivate $aw; |
This file contains hidden or 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
1. Edit the config file | |
vi /etc/mysql/mysql.conf.d/mysqld.cnf | |
Change | |
bind-address = 127.0.0.1 | |
to | |
bind-address = 0.0.0.0 | |
2. Restart mysql | |
systemctl restart mysql |
This file contains hidden or 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
Во MySQL верзија 5.6 и поголеми (со Ubuntu 16.04 доаѓа v5.7+) има проблем со упис на *празни* датуми во датумски полиња каде што е наведено дека полето е "not null". | |
Уписите од Infomatrix и другите апликации, паѓаат со порака дека не е дозволена вредност '' (празен стринг) во датумско поле. | |
Ова *мора* да се направи на секоја нова инсталација каде што доаѓа MySQL v5.6 и поголема | |
Отвори | |
/etc/mysql/mysql.conf.d/mysqld.cnf | |
Во одделот [mysqld] додади: | |
sql_mode = NO_ENGINE_SUBSTITUTION |
This file contains hidden or 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
-- ------------------------------------------------------------------ | |
-- Bara posledna cena za artikal vo tabela so ceni po datumi | |
-- ------------------------------------------------------------------ | |
select | |
temp_promet.* | |
from temp_promet | |
inner join ( | |
select | |
artikal_id as artikal_id, | |
max(datum_ddo) as max_datum_ddo, |
This file contains hidden or 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
Since 2018 openvpn no longer works on ubuntu server 12.04 with out-of-the-box apt-get install. | |
First you need the following dependencies: | |
apt-get install libpkcs11-helper1 | |
apt-get install liblzo2-2 | |
then run: | |
apt-get install openvpn |