Skip to content

Instantly share code, notes, and snippets.

View erhangundogan's full-sized avatar
👋

Erhan Gundogan erhangundogan

👋
View GitHub Profile
@erhangundogan
erhangundogan / application-ld+json.html
Last active February 5, 2025 20:00
application/ld+json
<!-- first -->
<script type="application/ld+json">
{
"@context": "https://schema.org",
"@type": "Article",
"dateModified": "2024-07-22",
"headline": "Erhan&amp;#39;s journey to the web"
}
</script>
@erhangundogan
erhangundogan / getAllCustomElements.js
Last active February 5, 2025 20:00
Find all custom elements on the page
const allCustomElements = [];
function isCustomElement(el) {
const isAttr = el.getAttribute('is');
// Check for <super-button> and <button is="super-button">.
return el.localName.includes('-') || isAttr && isAttr.includes('-');
}
function findAllCustomElements(nodes) {
for (let i = 0, el; el = nodes[i]; ++i) {
@erhangundogan
erhangundogan / trips.md
Last active March 26, 2025 08:43
My trips

North America

  • East coast (NY, Washington)
  • Florida (Miami)
  • Midwest (Chicago, Mount Rushmore)
  • Nevada (Las Vegas)
  • Southeastern (New Orleans)
  • West coast (Los Angeles, San Francisco)

Latin America / Caribbean

  • Bahamas
@erhangundogan
erhangundogan / StorageClass.yml
Last active May 20, 2023 08:23
kubernetes bare metal setup for Debian 10 (buster)
apiVersion: storage.k8s.io/v1
kind: StorageClass
metadata:
name: openebs-lvmpv
allowVolumeExpansion: true
parameters:
storage: "lvm"
volgroup: "vg0"
reclaimPolicy: Retain
volumeBindingMode: WaitForFirstConsumer

Graph Algorithms

  • Breadth First Search (BFS)
  • Depth First Search (DFS)
  • Shortest Path from source to all vertices Dijkstra
  • Shortest Path from every vertex to every other vertex Floyd Warshall
  • Minimum Spanning tree Prim
  • Minimum Spanning tree Kruskal
  • Topological Sort
@erhangundogan
erhangundogan / typescript-diagnostic.sh
Last active January 11, 2024 20:58
TypeScript compiler CLI commands to debug and diagnose your builds
# npm i -g typescript
# change directory to your project
# Prints out tsconfig.json including extended options if there is any.
tsc --showConfig
# You can use this flag to discover where TypeScript is spending it’s time when compiling
# https://github.com/microsoft/TypeScript/wiki/Performance
tsc --extendedDiagnostics
@erhangundogan
erhangundogan / image-related.md
Last active February 5, 2025 20:08
Image related brew files
@erhangundogan
erhangundogan / currencies.js
Last active March 8, 2021 11:48
JS/JSON array of circulating currencies
// extracted from https://en.wikipedia.org/wiki/List_of_circulating_currencies
export default [
'AED',
'AFN',
'ALL',
'AMD',
'ANG',
'AOA',
'ARS',
'AUD',
@erhangundogan
erhangundogan / test.ml
Last active July 1, 2021 12:53
ocaml alcotest example
(*
utop # Alcotest.check Alcotest.string "foo" "abc" "abc";;
ASSERT foo
- : unit = ()
*)
(* A module with functions to test *)
module To_test = struct
let lowercase = String.lowercase_ascii
let list_concat = List.append