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 | |
/** | |
* imap-attachment.php | |
* | |
* @author hakre <hakre.wordpress.com> | |
* @link http://stackoverflow.com/questions/9974334/how-to-download-mails-attachment-to-a-specific-folder-using-imap-and-php | |
*/ | |
/** | |
* Utility Class |
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
// в некоторых случаях автосохранение и автоподстановка пароля в гугл хром может быть большой проблемой | |
// данный компонент позволяет сделать окно авторизации таким, что секюрность ввода пароля будет соблюдена | |
// и хром не распознает ввод пароля и, соответственно, не будет предлагать его сохранить или использовать | |
// сохраненный пароль | |
// использование комплнента очень простое | |
// в шаблоне <login-pawwsord v-model="mypassword"> | |
// в кодовой части | |
// components:{ | |
// LoginPassword:()=>import('./login-password') | |
// } |
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
#!/bin/bash | |
# | |
# An example init script for running a Node.js process as a service | |
# using Forever as the process monitor. For more configuration options | |
# associated with Forever, see: https://github.com/nodejitsu/forever | |
# | |
# You will need to set the environment variables noted below to conform to | |
# your use case, and change the init info comment block. | |
# | |
# This was written for Debian distributions such as Ubuntu, but should still |
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
Number.prototype.toPhrase = function (fem, one, two, three, four, five) | |
// Число прописью от 0 до 999 триллионов | |
// 100.toPhrase(false, 'чайник', 'чайника', 'чайника', 'чайника', 'чайников') | |
{ | |
var x = Math.round((this + Number.EPSILON) * 100) / 100; | |
if (x < 0 || x > 999999999999999.99) return false; | |
if (fem === undefined) fem = true; | |
if (!one) one = 'единица'; | |
if (!two) two = 'единицы'; |
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
CREATE DEFINER=`root`@`%` FUNCTION `GEN_EAN8`( | |
`CODE` INT | |
) | |
RETURNS vARCHAR(8) | |
LANGUAGE SQL | |
NOT DETERMINISTIC | |
NO SQL | |
SQL SECURITY DEFINER | |
COMMENT '' |
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
CREATE FUNCTION `GEN_EAN13`( | |
`CODE` INT | |
) | |
RETURNS VARCHAR(13) | |
LANGUAGE SQL | |
NOT DETERMINISTIC | |
NO SQL | |
SQL SECURITY DEFINER | |
COMMENT '' | |
BEGIN |
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
var winston = require('winston') | |
// set default log level. | |
var logLevel = 'info' | |
// Set up logger | |
var customColors = { | |
trace: 'white', | |
debug: 'green', | |
info: 'blue', |
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
// Include Nodejs' net module. | |
const Net = require('net'); | |
// The port number and hostname of the server. | |
const port = 55555; | |
const host = 'localhost'; | |
// Create a new TCP client. | |
const client = new Net.Socket(); |
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 { | |
methods: { | |
/** | |
* Copying properties of one object to another while maintaining reactivity | |
* | |
* @param _from | |
* @param _to | |
*/ | |
deepCopy(_from, _to) { | |
if (Array.isArray(_from)) { |