Skip to content

Instantly share code, notes, and snippets.

.dashboard-event-tile {
display: grid;
// small screen
grid-template-areas: "image content"
"image content"
". meta";
// medium screen
@media screen and (min-width: 45rem) {
@konami99
konami99 / event.css
Last active February 26, 2024 11:31
Responsive Grid Layout.css
.dashboard-event-tile {
display: grid;
// small screen
grid-template-rows: 1fr auto auto;
grid-template-columns: 4.375rem 1fr;
// medium screen
@media screen and (min-width: 45rem) {
grid-template-rows: 1fr auto auto;
@konami99
konami99 / event.html
Created February 26, 2024 10:51
Responsive Grid Layout.html
<div class="dashboard-event-tile">
<div class="image">
</div>
<div class="content">
</div>
<div class="meta">
</div>
</div>
@konami99
konami99 / doublyLinkedList.ts
Created February 8, 2024 21:07
doubly Linked List
class NodeP<T> {
value: T;
previous: NodeP<T> | undefined;
next: NodeP<T> | undefined;
constructor(value: T) {
this.value = value;
}
}
@konami99
konami99 / linkedList.ts
Created February 8, 2024 21:06
linked list
class NodePoint<T> {
value: T;
next: NodePoint<T> | null;
constructor(value: T) {
this.value = value;
this.next = null;
}
}
@konami99
konami99 / webflowtimezoneconverter.js
Last active March 10, 2023 23:09
Webflow timezone conversion
<script src="https://cdn.jsdelivr.net/npm/luxon@3.3.0/build/global/luxon.min.js"></script>
<script>
const defaultTimezone = 'Asia/Taipei'; // Change this to your site time zone https://university.webflow.com/lesson/time-zone
const local = luxon.DateTime.local();
const localZoneName = local.zoneName;
$(function() {
@konami99
konami99 / dijkstras_algorithm.rb
Last active January 29, 2023 10:29
Dijkstra's Algorithm
class City
attr_accessor :name, :routes
def initialize(name)
@name = name
@routes = {}
end
def add_route(city, price)
@routes[city] = price
end
def bfs_traverse(starting_vertex)
queue = Queue.new
visited_vertices = {}
visited_vertices[starting_vertex.value] = true
queue.enqueue(starting_vertex)
# While the queue is not empty:
while queue.read
# Remove the first vertex off the queue and make it the current vertex:
current_vertex = queue.dequeue
# Print the current vertex's value:
@konami99
konami99 / trie.py
Last active January 24, 2023 10:11
Trie
class TrieNode:
def __init__(self):
self.children = {}
class Trie:
def __init__(self):
self.root = TrieNode()
def search(self, word):
currentNode = self.root
@konami99
konami99 / handler.py
Last active November 11, 2022 09:35
Invoking Step Functions from Lambda
import json
import boto3
sfn = boto3.client('stepfunctions')
def lambda_handler(event, context):
sfn_st = "arn:aws:states:ap-southeast-2:123456789:stateMachine:StepFunctionArn"
data = []
for unicorn in unicorns_to_feed:
obj = {}