Skip to content

Instantly share code, notes, and snippets.

@rileynwong
rileynwong / dfs.py
Created December 24, 2018 22:57
Depth-first search on a tree (directed, acyclic graph)
def dfs(graph, start_node, search_node):
"""
Depth-first search for a node in a tree (directed, acyclic graph).
Input:
graph (dict)
node we are starting our search with (String)
node we are searching for (String)
Output: whether or not the node was found in the graph (bool)
"""

Keybase proof

I hereby claim:

  • I am rileynwong on github.
  • I am rileywong (https://keybase.io/rileywong) on keybase.
  • I have a public key ASCbtd9nFTXiVJOYAiQAcTyCwYJB9hc2r9H_CP_wBXR_Ugo

To claim this, I am signing this object:

@rileynwong
rileynwong / convert_flac.sh
Created February 11, 2025 10:53
Convert flac to mp3. cd into a folder containing flac files and run:
for f in *.flac; do ffmpeg -i "$f" -ab 320k -map_metadata 0 -id3v2_version 3 "${f%.flac}.mp3"; done