Skip to content

Instantly share code, notes, and snippets.

@AnthoniG
AnthoniG / ResponsiveTable.vue
Created July 18, 2025 20:24
Responsive tables on mobile screens using TailwindCSS
<template>
<div class="p-5 h-screen bg-gray-100">
<h1 class="text-xl mb-2">Your orders</h1>
<div class="overflow-auto rounded-lg shadow hidden md:block">
<table class="w-full">
<thead class="bg-gray-50 border-b-2 border-gray-200">
<tr>
<th class="w-20 p-3 text-sm font-semibold tracking-wide text-left">No.</th>
<th class="p-3 text-sm font-semibold tracking-wide text-left">Details</th>
@AnthoniG
AnthoniG / tips.ts
Created July 18, 2025 08:34 — forked from TomProBLD/tips.ts
TypeScript Tips
/**
* ---
* ---
* Partial, Pick, Omit and Required
* ---
* ---
*/
interface Props {
key1: string;
key2: number;
@AnthoniG
AnthoniG / pythonstartup.py
Created June 26, 2024 13:30 — forked from ksamuel/pythonstartup.py
Python startup script
import atexit
# First, a lot of imports. I don't use all of them all the time,
# but I like to have them available.
import csv
import datetime as dt
import hashlib
import json
import math
@AnthoniG
AnthoniG / curlget.cpp
Created March 14, 2024 04:44 — forked from whoshuu/curlget.cpp
Example libcurl GET request
#include <curl/curl.h>
#include <string>
size_t writeFunction(void *ptr, size_t size, size_t nmemb, std::string* data) {
data->append((char*) ptr, size * nmemb);
return size * nmemb;
}
int main(int argc, char** argv) {
auto curl = curl_easy_init();
@AnthoniG
AnthoniG / .gitignore
Created March 11, 2024 15:04 — forked from evandrocoan/.gitignore
Simple C++ program example to run tests together with your code using doctest.
/build
from PySide6 import QtWidgets
import sys
from tests.test_tree import TreeModel
class TreeWindow(QtWidgets.QMainWindow):
def __init__(self):
super().__init__()
self.tree_view = QtWidgets.QTreeView()
from PySide6 import QtCore
class TreeItem:
def __init__(self, data, parent=None):
self.parent_item = parent
self.item_data = data
self.child_items = []
def appendChild(self, item):
self.child_items.append(item)
@AnthoniG
AnthoniG / qt_proxy_model.py
Created August 17, 2023 03:22 — forked from justinfx/qt_proxy_model.py
Minimal Qt example of adding a "virtual row" via a proxy model
#!/usr/bin/env python
"""
Refs:
"[Maya-Python] Customized display of files/folders in a QTreeView that is using QFileSystemModel."
https://groups.google.com/d/topic/python_inside_maya/TaFm2yNToJ8/discussion
"""
from PySide import QtCore, QtGui
@AnthoniG
AnthoniG / treeview_test.py
Created August 15, 2023 06:06 — forked from nbassler/treeview_test.py
PyQt5 TreeView with QAbstractItemModel
"""
Reworked code based on
http://trevorius.com/scrapbook/uncategorized/pyqt-custom-abstractitemmodel/
Adapted to Qt5 and fixed column/row bug.
TODO: handle changing data.
"""
import sys
import type { V2_HtmlMetaDescriptor, V2_MetaFunction } from "@remix-run/node";
export const mergeMeta = (
overrideFn: V2_MetaFunction,
appendFn?: V2_MetaFunction,
): V2_MetaFunction => {
return arg => {
// get meta from parent routes
let mergedMeta = arg.matches.reduce((acc, match) => {
return acc.concat(match.meta || []);