- Download the latest zsh package: https://packages.msys2.org/package/zsh?repo=msys&variant=x86_64
Example:
zsh-5.7.1-1-x86_64.pkg.tar.xz
Example:
zsh-5.7.1-1-x86_64.pkg.tar.xz
Spread vs JSON.parse speed when calling simple function
const N = 100000;
function test(obj) {
var result = obj.a + obj.b;
return result;
}
function test2(obj) {
var result = obj.a + obj.b;
| Add to ~/.vimrc: | |
| set mouse-=a | |
| Then uncomment these lines in /etc/vim/vimrc: | |
| let g:skip_defaults_vim = 1 | |
| syntax on |
| (12345.6789).toLocaleString("fa-IR"); // ۱۲٬۳۴۵٫۶۷۹ | |
| var now = new Date(); | |
| now.toLocaleString(); // 1/27/2018, 12:07:03 AM | |
| now.toLocaleDateString(); // 1/27/2018 | |
| now.toLocaleTimeString(); // 12:07:03 AM | |
| now.toLocaleString("fa-IR") // ۱۳۹۶/۱۱/۷، ۰:۰۷:۰۳ | |
| now.toLocaleDateString("fa-IR") // ۱۳۹۶/۱۱/۷ |
When writing django apps it's easy to ignore the organization of your front end code. Often, these backend coders will just write a static js and css file, stick it in the static directory, and call it a day.
You can also build them as two completely independent parts. With a complex gulp build routine independent of the django app. But if you don't know gulp, node, or those kinds of systems it can be a daunting process to get started with.
Enter django-compressor-toolkit (the name doesn't quite roll off the tongue).
Using django-compressor and django-compressor-toolkit you can write Javascript ES6 code with all its fancy import/export logic or style your pages with sass instead of css, and leave your deploy routine largely untouched.
| var gulp = require('gulp'), | |
| sass = require('gulp-sass'), | |
| rename = require('gulp-rename'), | |
| cssmin = require('gulp-cssnano'), | |
| prefix = require('gulp-autoprefixer'), | |
| plumber = require('gulp-plumber'), | |
| notify = require('gulp-notify'), | |
| sassLint = require('gulp-sass-lint'), | |
| sourcemaps = require('gulp-sourcemaps'); | |
| // Temporary solution until gulp 4 |
| Disable vim automatic visual mode on mouse select | |
| issue: :set mouse-=a | |
| add to ~/.vimrc: set mouse-=a | |
| my ~/.vimrc for preserving global defaults and only changing one option: | |
| source $VIMRUNTIME/defaults.vim | |
| set mouse-=a |
| <?php | |
| // Add the code below to your theme's functions.php file to add a confirm password field on the register form under My Accounts. | |
| add_filter('woocommerce_registration_errors', 'registration_errors_validation', 10,3); | |
| function registration_errors_validation($reg_errors, $sanitized_user_login, $user_email) { | |
| global $woocommerce; | |
| extract( $_POST ); | |
| if ( strcmp( $password, $password2 ) !== 0 ) { | |
| return new WP_Error( 'registration-error', __( 'Passwords do not match.', 'woocommerce' ) ); | |
| } |
| " Don't try to be vi compatible | |
| set nocompatible | |
| " Helps force plugins to load correctly when it is turned back on below | |
| filetype off | |
| " TODO: Load plugins here (pathogen or vundle) | |
| " Turn on syntax highlighting | |
| syntax on |