Skip to content

Instantly share code, notes, and snippets.

View GC-Mark's full-sized avatar

Mark Beech GC-Mark

View GitHub Profile
DROP TABLE IF EXISTS time_dimension;
CREATE TABLE time_dimension (
id INTEGER PRIMARY KEY, -- year*10000+month*100+day
db_date DATE NOT NULL,
year INTEGER NOT NULL,
month INTEGER NOT NULL, -- 1 to 12
day INTEGER NOT NULL, -- 1 to 31
quarter INTEGER NOT NULL, -- 1 to 4
week INTEGER NOT NULL, -- 1 to 52/53
day_name VARCHAR(9) NOT NULL, -- 'Monday', 'Tuesday'...
@GC-Mark
GC-Mark / Article.md
Last active August 29, 2015 14:08 — forked from Warry/Article.md

How to make faster scroll effects?

  • Avoid too many reflows (the browser to recalculate everything)
  • Use advanced CSS3 for graphic card rendering
  • Precalculate sizes and positions

Beware of reflows

The reflow appens as many times as there are frames per seconds. It recalculate all positions that change in order to diplay them. Basically, when you scroll you execute a function where you move things between two reflows. But there are functions that triggers reflows such as jQuery offset, scroll... So there are two things to take care about when you dynamically change objects in javascript to avoid too many reflows:

@GC-Mark
GC-Mark / generate.sh
Last active April 20, 2017 13:41
Create a Wildcard SubjectAltName Self-Signed Certificate
#!/usr/bin/env bash
# See: http://apetec.com/support/GenerateSAN-CSR.htm
# See: http://fbcs.co.uk/self-signed-multiple-domain-ssl-certificates/
# See: https://gist.github.com/scottvrosenthal/5691305
# Make a temp directory and go there
TMP_DIR=$(mktemp -d)
cd $TMP_DIR
echo $(pwd)