Skip to content

Instantly share code, notes, and snippets.

View zdimension's full-sized avatar

Tom Niget zdimension

View GitHub Profile
@harvimt
harvimt / alchemical_model.py
Created February 2, 2013 20:41
SQLAlchemy to/from PyQt Adapters
#!/usr/bin/env python2
#-*- coding=utf-8 -*-
# © 2013 Mark Harviston, BSD License
from __future__ import absolute_import, unicode_literals, print_function
"""
Qt data models that bind to SQLAlchemy queries
"""
from PyQt4 import QtGui
from PyQt4.QtCore import QAbstractTableModel, QVariant, Qt
import logging # noqa
@aras-p
aras-p / preprocessor_fun.h
Last active July 16, 2024 02:50
Things to commit just before leaving your job
// Just before switching jobs:
// Add one of these.
// Preferably into the same commit where you do a large merge.
//
// This started as a tweet with a joke of "C++ pro-tip: #define private public",
// and then it quickly escalated into more and more evil suggestions.
// I've tried to capture interesting suggestions here.
//
// Contributors: @r2d2rigo, @joeldevahl, @msinilo, @_Humus_,
// @YuriyODonnell, @rygorous, @cmuratori, @mike_acton, @grumpygiant,
@vimtaai
vimtaai / markdown-flavors.md
Last active July 21, 2024 11:54
Comparison of features in various Markdown flavors

Comparison of syntax extensions in Markdown flavors

I created a crude comparison of the syntax of the various common Markdown extensions to have a better view on what are the most common extensions and what is the most widely accepted syntax for them. The list of Markdown flavors that I looked at was based on the list found on CommonMark's GitHub Wiki.

Flavor Superscript Subscript Deletion*
Strikethrough
Insertion* Highlight* Footnote Task list Table Abbr Deflist Smart typo TOC Math Math Block Mermaid
GFM
@FlorianLatapie
FlorianLatapie / snake.py
Last active December 30, 2022 17:01
Simple python snake using curses, on Windows use the command `pip install windows-curses` to install curses, using PyCharm IDE make sure that you enabled the "Emulate termianl in output console" option to make it work
import curses
from curses import KEY_RIGHT, KEY_LEFT, KEY_UP, KEY_DOWN
from random import randint
# Constants
KEY_ESC = 27
height = 10
width = 40
half_height = int(height / 2)
@FlorianLatapie
FlorianLatapie / AreYouDumb.java
Last active December 30, 2022 17:00
I got lost on Instagram and wanted to recreate what I saw.
import javax.swing.*;
import java.awt.*;
import java.awt.event.MouseAdapter;
import java.awt.event.MouseEvent;
import java.util.Random;
import static javax.swing.SwingConstants.CENTER;
public class AreYouDumb extends JFrame {
private final JLabel label;
@FlorianLatapie
FlorianLatapie / mvn_win_install.cmd
Last active November 7, 2023 13:10
Apache Maven 3.8.6 auto install script for Windows *run the script with admin privileges*
@ECHO off
REM @Author Florian Latapie
echo Apache Maven auto install script for Windows & echo. & echo Downloading the zip file & echo.
curl -o tmp.zip https://dlcdn.apache.org/maven/maven-3/3.8.6/binaries/apache-maven-3.8.6-bin.zip
echo Installation & echo.
powershell -command "Expand-Archive tmp.zip 'C:\Program Files\apache'"
setx /M PATH "%PATH%;C:\Program Files\apache\apache-maven-3.8.6\bin"
del tmp.zip
@FlorianLatapie
FlorianLatapie / tictactoe.py
Created June 9, 2022 14:32
Simple python Tic-tac-toe using the mouse in the terminal with curses, on Windows use the command `pip install windows-curses` to install curses
import curses
# Constants
import random
KEY_ESC = 27
X = "X"
O: str = "O"
EMPTY = " "
@nonnullish
nonnullish / making-windows-11-usable.md
Last active June 16, 2024 03:39
Making Windows 11 Usable

Making Windows 11 Usable

Remove Garbage

Sophia Script for Windows

Keep in mind that if you're not careful when selecting the settings, not only will it remove the preinstalled TikTok app but also the default photo viewer. Other than that works great.

Fix Explorer and Right Click Menus

Explorer Patcher

@RobertAKARobin
RobertAKARobin / safari.md
Last active July 8, 2024 11:29
Safari's date-picker is the cause of 1/3 of our customer support issues

Safari's date-picker is the cause of 1/3 of our customer support issues

...and obviously we're building a workaround. But I'm absolutely flabbergasted that a standard <input type="date"> HTML field, in a standard browser, from a company that bases its reputation good design, could be so dreadful.

The context

I'm the developer for a startup that sells a genetic test to recommend medications for high blood pressure. For medical reasons we need to know our customers' birth date. Most of our customers are in their 60s or older. We've found that many of them use iPads or iPhones. And they're the ones who complain to our customer support that our site is unusable.

The problem

@m3rlinux
m3rlinux / simple-rrd-merge.py
Last active June 25, 2024 01:30 — forked from arantius/simple-rrd-merge.py
add support for python3
#!/usr/bin/env python
"""Simple script to merge multiple RRD files together.
Accepts any number of RRD file names as arguments. Produces an "rrdtool dump"
style file on stdout. The last RRD file should have a slot for every possible
record in the resulting merged RRD.
Run something like:
$ python simple-merge-rrd.py filea.rrd fileb.rrd filec.rrd | \