Skip to content

Instantly share code, notes, and snippets.

View jayralencar's full-sized avatar
:octocat:
Focusing

Jayr Alencar Pereira jayralencar

:octocat:
Focusing
View GitHub Profile
@bryhal
bryhal / gist:4129042
Created November 22, 2012 02:08
MYSQL: Generate Calendar Table
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'...
@geekforbrains
geekforbrains / post-receive
Created May 18, 2012 19:11
Git post-receive rsync to remote server
#!/bin/bash
REPO=NAME_HERE
# Dir paths on remote server
# These are associated with branches within a git project
LIVE_BRANCH="master"
LIVE="git@host:/var/www/live/"
STAGE_BRANCH="develop"
STAGE="git@host:/var/www/stage/"