- Don’t
SELECT *
, Specify explicit column names (columnar store) - Avoid large JOINs (filter each table first)
- In PRESTO tables are joined in the order they are listed!!
- Join small tables earlier in the plan and leave larger fact tables to the end
- Avoid cross joins or 1 to many joins as these can degrade performance
- Order by and group by take time
- only use order by in subqueries if it is really necessary
- When using GROUP BY, order the columns by the highest cardinality (that is, most number of unique values) to the lowest.
// ==UserScript== | |
// @name userscript boilerplate | |
// @namespace userscriptnamespace | |
// @version 1 | |
// @description Script description | |
// @author Author | |
// @match http://asdf.com/* | |
// @require https://cdnjs.cloudflare.com/ajax/libs/jquery/3.4.1/jquery.min.js | |
// @require https://cdnjs.cloudflare.com/ajax/libs/jquery-popup-overlay/2.1.1/jquery.popupoverlay.min.js | |
// @require https://cdnjs.cloudflare.com/ajax/libs/jquery.serializeJSON/2.9.0/jquery.serializejson.min.js |
This is a solution on how to theme/customize Ant Design (which is written in Less) with Sass and webpack. Ant itself offers two solutions and a related article on theming, but these are only applicable if you use Less, the antd-init boilerplate or dva-cli.
- use a single sass-file to customize (no duplicate variables for your project and Ant)
- hot reload compatibility
- no dependencies on outdated npm modules
- easy integration with your existing webpack setup (webpack 3+ tested)
// cropAndStraightenBatch.jsx | |
// Copyright 2006-2008 | |
// Written by Jeffrey Tranberry | |
// Photoshop for Geeks Version 2.0 | |
/* | |
Description: | |
This script demonstates how to batch process | |
a folder of images using the crop and straighten command | |
*/ |
:root { | |
--ease-in-quad: cubic-bezier(.55, .085, .68, .53); | |
--ease-in-cubic: cubic-bezier(.550, .055, .675, .19); | |
--ease-in-quart: cubic-bezier(.895, .03, .685, .22); | |
--ease-in-quint: cubic-bezier(.755, .05, .855, .06); | |
--ease-in-expo: cubic-bezier(.95, .05, .795, .035); | |
--ease-in-circ: cubic-bezier(.6, .04, .98, .335); | |
--ease-out-quad: cubic-bezier(.25, .46, .45, .94); | |
--ease-out-cubic: cubic-bezier(.215, .61, .355, 1); |
MailChimp's default popup scripts can break on WordPress sites that use jQuery/jQuery UI unless you include their embed code as the final elements before the closing body tag.
Including them in this way isn't always possible or easy with WordPress.
The code below is an alternative implementation of the loader that forces MailChimp's popup scripts to appear below all other scripts upon page load.
To use it, modify the baseUrl
, uuid
, and lid
attributes with the ones from the original popup script that MailChimp supplies.
""" | |
Minimal character-level Vanilla RNN model. Written by Andrej Karpathy (@karpathy) | |
BSD License | |
""" | |
import numpy as np | |
# data I/O | |
data = open('input.txt', 'r').read() # should be simple plain text file | |
chars = list(set(data)) | |
data_size, vocab_size = len(data), len(chars) |
// this is the background code... | |
// listen for our browerAction to be clicked | |
chrome.browserAction.onClicked.addListener(function (tab) { | |
// for the current tab, inject the "inject.js" file & execute it | |
chrome.tabs.executeScript(tab.ib, { | |
file: 'inject.js' | |
}); | |
}); |
# Change YOUR_TOKEN to your prerender token | |
# Change example.com (server_name) to your website url | |
# Change /path/to/your/root to the correct value | |
server { | |
listen 80; | |
server_name example.com; | |
root /path/to/your/root; | |
index index.html; |
/** | |
* Get a random floating point number between `min` and `max`. | |
* | |
* @param {number} min - min number | |
* @param {number} max - max number | |
* @return {number} a random floating point number | |
*/ | |
function getRandomFloat(min, max) { | |
return Math.random() * (max - min) + min; | |
} |