Skip to content

Instantly share code, notes, and snippets.

View aahmd's full-sized avatar
🎯
Focusing

Adam Ahmed aahmd

🎯
Focusing
  • Data Engineer
  • Washington D.C.
View GitHub Profile
@aahmd
aahmd / player.py
Created February 24, 2019 06:00
video player using tkinter + vlc python bindings
#! /usr/bin/python
# -*- coding: utf-8 -*-
"""vlc media player; based off example in vlc repo:
`http://git.videolan.org/?p=vlc/bindings/python.git;a=commit;h=HEAD`
See also:
`http://infohost.nmt.edu/tcc/help/pubs/tkinter/web/menu.html`
`http://infohost.nmt.edu/tcc/help/pubs/tkinter/web/menu-coptions.html`
@aahmd
aahmd / gist:87389b2fe5b5cae6f43226748fad5988
Last active February 23, 2024 00:26
pyspark queries
# for records grouped by colA, colB, and colC return a df where colD is unique:
import pyspark.sql.functions as fn
df.groupBy('colA', 'colB', 'colC').agg(fn.collect_list('colD').alias('newColD'), fn.count('colD').alias('count').filter(fn.col('count') > 1))
df.select(fn.explode('newColD').alias('colDUniques')).show()
# given a subset of columns, return a dataframe where duplciates exists for these columns:
@MohamedAlaa
MohamedAlaa / tmux-cheatsheet.markdown
Last active May 28, 2024 14:54
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname