Skip to content

Instantly share code, notes, and snippets.

@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 || []);
@AnthoniG
AnthoniG / exec.go
Created June 28, 2023 20:41 — forked from danesparza/exec.go
Go exec.Command example
package main
import (
"bytes"
"fmt"
"os/exec"
"strings"
)
func main() {
@AnthoniG
AnthoniG / drop_encrypt.go
Created June 5, 2023 23:11 — forked from 17twenty/drop_encrypt.go
Golang - Drag and Drop AES Encryption and Decryption
package main
import (
"crypto/aes"
"crypto/cipher"
"crypto/rand"
"fmt"
"io"
"io/ioutil"
"os"
@AnthoniG
AnthoniG / README.md
Created May 2, 2023 20:56 — forked from int128/README.md
Watching build mode on Create React App

Create React App does not provide watching build mode oficially (#1070).

This script provides watching build mode for an external tool such as Chrome Extensions or Firebase app.

How to Use

Create a React app.

Put the script into scripts/watch.js.