Skip to content

Instantly share code, notes, and snippets.

View dramaticlly's full-sized avatar

Hongyue/Steve Zhang dramaticlly

View GitHub Profile
# GIT heart FZF
# -------------
is_in_git_repo() {
git rev-parse HEAD > /dev/null 2>&1
}
fzf-down() {
fzf --height 50% --min-height 20 --border --bind ctrl-/:toggle-preview "$@"
}
@smartnose
smartnose / spark-internals-through-code.md
Last active October 29, 2024 06:03
Spark internal notes

Spark internals through code

Nothing gives you more detail about spark internals than actually reading it source code. In addition, you get to learn many design techniques and improve your scala coding skills. These are the random notes I make while reading the spark code. The best way to comprehend the notes is to load spark code into an IDE, e.g. IntelliJ, and navigate the code on the side.

Genesis - creation of a spark cluster

The scripts for creating a spark cluster are: start-master.sh and start-slave.sh. Read them carefully, and you can see that both scripts are very similar except the values for $CLASS variable. For start-master.sh, the value is CLASS="org.apache.spark.deploy.master.Master", while the value for start-slave.sh is shown below with more context.

# NOTE: This exact class name is matched downstream by SparkSubmit.
@bernardolopes8
bernardolopes8 / BookPersister.java
Last active November 15, 2024 13:04
Jersey Pagination, Sorting, and Filtering Example
package my.application.dao;
import java.util.List;
import my.application.entity.Book;
import my.application.restutil.RequestOptions;
public interface BookPersister {
List<Book> getBooks(RequestOptions requestOptions);
}
@sebsto
sebsto / gist:2ce59d80a3b5d30bb1ee456e96bf0fb0
Last active July 25, 2024 15:13
Redshift Materialized View Demo
drop table store;
drop table sales;
drop materialized view city_sales;
CREATE TABLE "sales" (
"id" int PRIMARY KEY,
"item" varchar,
@dramaticlly
dramaticlly / nexus_bot.py
Created July 19, 2024 18:42
Nexus appointment bot with local desktop notification
import argparse
import logging
import os
import sys
from datetime import datetime, timedelta
# import google.cloud.logging
import requests
# import twitter