Skip to content

Instantly share code, notes, and snippets.

View shauryashaurya's full-sized avatar
🎨
Focusing

Shaurya Agarwal shauryashaurya

🎨
Focusing
View GitHub Profile
@shauryashaurya
shauryashaurya / Quick PySpark Assessment.md
Last active February 26, 2025 11:13
Quick PySpark Assessment

Step 1: Basic PySpark Qualifier

Part 1: Multiple Choice Assessment (Basic PySpark Concepts)

Here are five multiple-choice questions to test fundamental PySpark knowledge:

  1. Which of the following is NOT a valid Spark transformation?
    • a) map
    • b) filter
  • c) reduceByKey
@shauryashaurya
shauryashaurya / gist:4553347fbab9daebf61b1e5eb99f2c74
Created October 11, 2023 02:30 — forked from hay/gist:1351230
Enterprisify your Java Class Names!
<!doctype html>
<html>
<head>
<title></title>
<style>
body {
background: white;
text-align: center;
padding: 20px;
font-family: Georgia, serif;
from fabric.api import local
import pip
def freeze ():
local("pip freeze > requirements.txt")
local("git add requirements.txt")
local("git commit -v")
def upgrade ():
for dist in pip.get_installed_distributions():
@shauryashaurya
shauryashaurya / build.gradle
Created June 24, 2023 09:07 — forked from thom-nic/build.gradle
find the largest classnames in Spring libraries. Also find FactoryFactories
/**
* Find the longest class names in Spring.
* Also find FactoryFactory classes.
* a goof-off project by @thom_nic
*/
import java.util.jar.*
defaultTasks 'longest', 'factoryfactory'
@shauryashaurya
shauryashaurya / knightmoves.py
Created October 17, 2022 20:24
minimum number of moves that a knight must make to go from a source cell to destination cell on a chessboard (8x8)
# minimum number of moves that a knight needs to go from source to destination.
# given that the chessboard looks like this:
# -------------------------
# | 0| 1| 2| 3| 4| 5| 6| 7|
# -------------------------
# | 8| 9|10|11|12|13|14|15|
# -------------------------
# |16|17|18|19|20|21|22|23|
# -------------------------
@shauryashaurya
shauryashaurya / 55-bytes-of-css.md
Created September 25, 2022 19:31 — forked from JoeyBurzynski/55-bytes-of-css.md
58 bytes of css to look great nearly everywhere

58 bytes of CSS to look great nearly everywhere

When making this website, i wanted a simple, reasonable way to make it look good on most displays. Not counting any minimization techniques, the following 58 bytes worked well for me:

main {
  max-width: 38rem;
  padding: 2rem;
  margin: auto;
}
@shauryashaurya
shauryashaurya / styles.css
Created August 31, 2022 04:35 — forked from patik/styles.css
Numbered Headings in Markdown via CSS
body { counter-reset: h1counter h2counter h3counter h4counter h5counter h6counter; }
h1 { counter-reset: h2counter; }
h2 { counter-reset: h3counter; }
h3 { counter-reset: h4counter; }
h4 { counter-reset: h5counter; }
h5 { counter-reset: h6counter; }
h6 {}
h2:before {
@shauryashaurya
shauryashaurya / linebreak.md
Created June 29, 2022 05:53
Line breaks in markdown
Hello  (<-- two spaces)
World

Hello
World


@shauryashaurya
shauryashaurya / Spark Dataframe Cheat Sheet.py
Created April 26, 2022 03:09 — forked from crawles/Spark Dataframe Cheat Sheet.py
Cheat sheet for Spark Dataframes (using Python)
# A simple cheat sheet of Spark Dataframe syntax
# Current for Spark 1.6.1
# import statements
from pyspark.sql import SQLContext
from pyspark.sql.types import *
from pyspark.sql.functions import *
#creating dataframes
df = sqlContext.createDataFrame([(1, 4), (2, 5), (3, 6)], ["A", "B"]) # from manual data
@shauryashaurya
shauryashaurya / BarnsleyFern.html
Created September 26, 2020 18:07
Barnsley Ferns
<html>
<head><script src="BarnsleyFern.js"></script></head>
<body onload="drawBarnsleyFern('canvas', 10000000,200,0.39)">
<br /> <h3>// Exploring Barnsley Fern Fractals</h3>
<h4>// shauryashaurya</h4>
<canvas id="canvas" width="4080" height="4080" style="border: 0px inset;"></canvas>
<h4>ref: https://mathworld.wolfram.com/BarnsleysFern.html</h4>
</body>
</html>