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
| "devDependencies": { | |
| "@babel/cli": "^7.5.0", | |
| "@babel/core": "^7.5.4", | |
| "@babel/plugin-syntax-dynamic-import": "^7.2", | |
| "@babel/plugin-transform-runtime": "^7.6.0", | |
| "@babel/polyfill": "^7.6.0", | |
| "@babel/preset-env": "^7.6.0", | |
| "@babel/preset-react": "^7.0.0", | |
| "@babel/register": "^7.4.4", | |
| "@babel/traverse": "^7.5.5", |
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
| "use strict"; | |
| // By Mahmoud Eskandari @ MIT license | |
| function validateCard(card) { | |
| if (typeof card === 'undefined' | |
| || card === null | |
| || card.length !== 16) { | |
| return false; | |
| } | |
| let cardTotal = 0; | |
| for (let i = 0; i < 16; i += 1) { |
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
| import Vue from 'vue'; | |
| import posts from './components/posts.vue'; | |
| window.axios = require('axios'); | |
| window.Vue = Vue; | |
| Vue.component('posts', posts); | |
| const app = new Vue({ | |
| el: '#app', |
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
| <?php | |
| function convert_non_persian_chars_to_persian ($str) { | |
| //main goal: arabic chars: from U+0600 (؀) to ۿ U+06FF (ۿ) | |
| //source: https://unicode-table.com/en | |
| $right_chars = array ( | |
| 'ا', | |
| 'ب', | |
| 'پ', | |
| 'ت', | |
| 'ث', |
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
| <?php | |
| error_reporting(E_ALL); | |
| $opts = getopt('f:d:rb:', ['ext:', 'php:', 'diff::']); | |
| if ((int)isset($opts['d']) + (int)isset($opts['f']) !== 1) { | |
| $self = basename(__FILE__); | |
| echo <<<EOF | |
| Usage: | |
| php $self -f<php_script> [-b] [--php <path_to_php>] [ --diff [<file>]] |
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
| <?php | |
| /** | |
| * ICS.php | |
| * ======= | |
| * Use this class to create an .ics file. | |
| * | |
| * Usage | |
| * ----- | |
| * Basic usage - generate ics file contents (see below for available properties): |
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
| <?php | |
| /** | |
| * Restore CSV upload functionality for WordPress 4.9.9 and up | |
| */ | |
| add_filter('wp_check_filetype_and_ext', function($values, $file, $filename, $mimes) { | |
| if ( extension_loaded( 'fileinfo' ) ) { | |
| // with the php-extension, a CSV file is issues type text/plain so we fix that back to | |
| // text/csv by trusting the file extension. | |
| $finfo = finfo_open( FILEINFO_MIME_TYPE ); | |
| $real_mime = finfo_file( $finfo, $file ); |
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
| const fs = require('fs') | |
| const csv = require('csv'); | |
| fs.createReadStream('data.csv') | |
| .pipe(csv.parse({columns: true})) | |
| .pipe(csv.transform((input) => { | |
| return Object.assign({}, input, { | |
| foo: input['foo'].toUpperCase() | |
| }); | |
| })) |
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
| #Note: This commands convert pure blob strings to utf8, if you use this commands on mixed strings, they didn't works as expected | |
| alter table sending_info change message message LONGTEXT CHARACTER SET latin1; | |
| alter table sending_info change message message LONGBLOB; | |
| alter table sending_info change message message LONGTEXT CHARACTER SET utf8; |
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
| <?php | |
| /* | |
| * @exampple: echo utf_correction('Ù…ØØªÙˆØ§ÛŒ میکس شده و بخش سالم'); | |
| * @link: https://stackoverflow.com/questions/48948340/mixed-encoding-and-make-everything-utf-8 | |
| **/ | |
| function utf_correction(''){ | |
| $str_hex = bin2hex($str); | |
| $str = hex2bin($str_hex); | |
| $fixed = preg_replace_callback( | |
| '/\\P{Arabic}+/u', |