Skip to content

Instantly share code, notes, and snippets.

View Lerking's full-sized avatar
πŸ’­
Developing

Lerking

πŸ’­
Developing
  • Denmark
View GitHub Profile
@Lerking
Lerking / README.md
Created February 1, 2023 20:08 — forked from Robert-96/README.md
Github Markdown Cheat Sheet
@Lerking
Lerking / gtk_random_depth_treeview_example.py
Last active March 15, 2023 09:44
Python code snippets
"""
Keywords: Python, gtk3, random, depth, treeview
A small example on adding random depth items to a gtk.treeview
To run this example, you need this file as well as the 'traverse_random_depth_nested_classes.py'
"""
import gi
gi.require.version('Gtk', '3.0')
from gi.repository import Gtk
@Lerking
Lerking / gist:f262a05d4788b88e9cd4866903959ff8
Created April 5, 2022 05:17 — forked from rxaviers/gist:7360908
Complete list of github markdown emoji markup

People

:bowtie: :bowtie: πŸ˜„ :smile: πŸ˜† :laughing:
😊 :blush: πŸ˜ƒ :smiley: ☺️ :relaxed:
😏 :smirk: 😍 :heart_eyes: 😘 :kissing_heart:
😚 :kissing_closed_eyes: 😳 :flushed: 😌 :relieved:
πŸ˜† :satisfied: 😁 :grin: πŸ˜‰ :wink:
😜 :stuck_out_tongue_winking_eye: 😝 :stuck_out_tongue_closed_eyes: πŸ˜€ :grinning:
πŸ˜— :kissing: πŸ˜™ :kissing_smiling_eyes: πŸ˜› :stuck_out_tongue:
@Lerking
Lerking / Regex_func.py
Created October 26, 2021 09:57
Regex demo for converting c header to asm inc file
import re
TOKENS = {"EXT_FUNC": "extern"}
function_extern = re.compile(r'^[\D+\s+]+[a-zA-Z]+[\s+|\(\w\W\)]+;|\s+[\D+]')
t = "void somefunction(p,p);"
t1 = "GType gtk_widget_get_type (void) G_GNUC_CONST;"
def external_func(txt):
x = re.search(function_extern, txt)
@Lerking
Lerking / starhscale.py
Created September 23, 2021 11:36 — forked from mendhak/starhscale.py
A custom GTK widget; horizontal slider with stars for rating an item
#!/usr/bin/env python
"""
StarHScale a Horizontal slider that uses stars
Copyright (C) 2006 Mark Mruss <selsine@gmail.com>
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
@Lerking
Lerking / wakatime_cfg_api_key.py
Last active September 6, 2021 09:38
Reading api_key from wakatime.cfg on Linux
from pathlib import Path
import configparser
home = str(Path.home())
config = configparser.RawConfigParser()
with open(home + "/.wakatime.cfg", "r") as cfgfile:
config.read_file(cfgfile)
print(config.get("settings", "api_key"))
@Lerking
Lerking / app.py
Created May 10, 2021 07:24 — forked from silviaclaire/app.py
Collapsible Tree Diagram using Flask and d3.js
import csv
import json
from flask import Flask, render_template
# reference: https://stackoverflow.com/questions/29631711/python-to-parent-child-json
# create a helper class for each tree node
class Node(object):
# generate new node
def __init__(self, cluster):