Skip to content

Instantly share code, notes, and snippets.

View bulletmark's full-sized avatar

Mark Blakeney bulletmark

  • Brisbane Australia
View GitHub Profile
@bulletmark
bulletmark / patch-gnome-shell-finger-count.py
Last active October 29, 2024 23:26
Patch gnome-shell to change GESTURE_FINGER_COUNT
#!/usr/bin/env python3
# Since GNOME 47, 4-finger gestures are mapped to the same standard
# GNOME gestures as 3-finger gestures. See
# https://gitlab.gnome.org/GNOME/gnome-shell/-/merge_requests/3275.
#
# This script patches gnome-shell to disable 3-finger gestures and only
# enable 4-finger gestures for standard GNOME, so you can assign
# 3-finger gestures to your own custom actions (e.g. using
# libinput-gestures). Simply run this as sudo/root then log out and back
# in, or restart. You will have to run it again if gnome-shell is
@bulletmark
bulletmark / day04.py
Created December 5, 2021 01:47
AOC 2021 Day 4
#!/usr/bin/python3
import numpy as np
DATA = 'data/day04'
def total(board):
return np.sum(board[board > 0])
def main():
boards = []
@bulletmark
bulletmark / gs-extract.sh
Last active September 1, 2023 00:50
Bash script to extract GNOME shell javascript files
#!/bin/bash
if [[ $# -ne 1 ]]; then
echo "usage $0 dir" >&2
exit 1
fi
dir="$1"
if [[ -e $dir ]]; then
echo "Error: $dir already exists" >&2
@Chaser324
Chaser324 / GitHub-Forking.md
Last active November 23, 2024 10:28
GitHub Standard Fork & Pull Request Workflow

Whether you're trying to give back to the open source community or collaborating on your own projects, knowing how to properly fork and generate pull requests is essential. Unfortunately, it's quite easy to make mistakes or not know what you should do when you're initially learning the process. I know that I certainly had considerable initial trouble with it, and I found a lot of the information on GitHub and around the internet to be rather piecemeal and incomplete - part of the process described here, another there, common hangups in a different place, and so on.

In an attempt to coallate this information for myself and others, this short tutorial is what I've found to be fairly standard procedure for creating a fork, doing your work, issuing a pull request, and merging that pull request back into the original project.

Creating a Fork

Just head over to the GitHub page and click the "Fork" button. It's just that simple. Once you've done that, you can use your favorite git client to clone your repo or j

@vsajip
vsajip / pyvenvex.py
Last active November 1, 2024 09:30
A script which demonstrates how to extend Python 3.3's EnvBuilder, by installing setuptools and pip in created venvs. This functionality is not provided as an integral part of Python 3.3 because, while setuptools and pip are very popular, they are third-party packages.The script needs Python 3.3 or later; invoke it using"python pyvenvex.py -h"fo…
#
# Copyright (C) 2013-2020 Vinay Sajip. New BSD License.
#
import os
import os.path
from subprocess import Popen, PIPE
import sys
from threading import Thread
from urllib.parse import urlparse
from urllib.request import urlretrieve