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;
// my little html string builder | |
buildHTML = function(tag, html, attrs) { | |
// you can skip html param | |
var h = document.createElement(tag); | |
var attrs = attrs || {}; | |
if (arguments.length == 2 && !((html) instanceof HTMLElement) && typeof(html) == "object") { | |
attrs = html; | |
html = null; | |
} |
<?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' ) ); | |
} |
Add to ~/.vimrc: | |
set mouse-=a | |
Then uncomment these lines in /etc/vim/vimrc: | |
let g:skip_defaults_vim = 1 | |
syntax on |
// Deep Breaths // | |
////////////////// | |
// Gulp | |
var gulp = require('gulp'); | |
// Sass/CSS stuff | |
var sass = require('gulp-sass'); | |
var prefix = require('gulp-autoprefixer'); | |
var minifycss = require('gulp-minify-css'); |
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;
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 |
from bs4 import BeautifulSoup as bs | |
from pyquery import PyQuery as pq | |
from lxml.html import fromstring | |
import re | |
import requests | |
import time | |
def Timer(): |
""" | |
Simple script to search a Z39.50 target using Python | |
and PyZ3950. | |
""" | |
from PyZ3950 import zoom | |
ISBNs = ['9781905017799', '9780596513986'] |
# Extension of http://www.yilmazhuseyin.com/blog/dev/create-thumbnails-imagefield-django/ | |
# Note: image_folder and thumbnail_folder are both a callable (ie. a lambda that does a '/'.join()) | |
class Image(Media): | |
image = models.ImageField( | |
upload_to=image_folder | |
) | |
thumbnail = models.ImageField( |