Skip to content

Instantly share code, notes, and snippets.

View AlizaminJ's full-sized avatar
💭
Coding

Alizamin Jafarli AlizaminJ

💭
Coding
View GitHub Profile
# Go to home directory
cd ~
# You can change what anaconda version you want at
# https://repo.continuum.io/archive/
wget https://repo.continuum.io/archive/Anaconda2-4.2.0-Linux-x86_64.sh
bash Anaconda2-4.2.0-Linux-x86_64.sh -b -p ~/anaconda
rm Anaconda2-4.2.0-Linux-x86_64.sh
echo 'export PATH="~/anaconda/bin:$PATH"' >> ~/.bashrc
@muness
muness / redshift_date_dim.sql
Last active March 14, 2024 17:38
Redshift Date Dimension
-- Potentially quirky when it comes to week numbers.
BEGIN TRANSACTION;
DROP TABLE IF EXISTS numbers_small;
CREATE TABLE numbers_small (
number SMALLINT NOT NULL
) DISTSTYLE ALL SORTKEY (number
);
INSERT INTO numbers_small VALUES (0), (1), (2), (3), (4), (5), (6), (7), (8), (9);
@sbealer
sbealer / redshift_dim_date.sql
Last active November 11, 2022 20:32
Redshift Date Dimension SQL
create
--drop
view dw.dim_date_vw as
WITH nums AS (
SELECT TOP 15000 row_number() over (
PARTITION BY NULL order by id) n
FROM l_browser -- or some other large table;
)
@wpscholar
wpscholar / vagrant-cheat-sheet.md
Last active April 25, 2024 12:11
Vagrant Cheat Sheet

Typing vagrant from the command line will display a list of all available commands.

Be sure that you are in the same directory as the Vagrantfile when running these commands!

Creating a VM

  • vagrant init -- Initialize Vagrant with a Vagrantfile and ./.vagrant directory, using no specified base image. Before you can do vagrant up, you'll need to specify a base image in the Vagrantfile.
  • vagrant init <boxpath> -- Initialize Vagrant with a specific box. To find a box, go to the public Vagrant box catalog. When you find one you like, just replace it's name with boxpath. For example, vagrant init ubuntu/trusty64.

Starting a VM

  • vagrant up -- starts vagrant environment (also provisions only on the FIRST vagrant up)