Skip to content

Instantly share code, notes, and snippets.

View tomlin7's full-sized avatar
🏖️
vacation

Billy tomlin7

🏖️
vacation
View GitHub Profile

git boomerang — Flip Your Git Staged

Git alias that flips your staged and unstaged changes (invert the index vs. working tree)

Given this:

[] staged_file.py (staged)
[] modified_file.js (unstaged)
import ctypes as ct
def dark_title_bar(window):
"""
MORE INFO:
https://docs.microsoft.com/en-us/windows/win32/api/dwmapi/ne-dwmapi-dwmwindowattribute
"""
window.update()
DWMWA_USE_IMMERSIVE_DARK_MODE = 20
set_window_attribute = ct.windll.dwmapi.DwmSetWindowAttribute
get_parent = ct.windll.user32.GetParent
@kkrypt0nn
kkrypt0nn / ansi-colors-discord.md
Last active June 17, 2025 05:34
A guide to ANSI on Discord

A guide to ANSI on Discord

Discord is now slowly rolling out the ability to send colored messages within code blocks. It uses the ANSI color codes, so if you've tried to print colored text in your terminal or console with Python or other languages then it will be easy for you.

Quick Explanation

To be able to send a colored text, you need to use the ansi language for your code block and provide a prefix of this format before writing your text:

\u001b[{format};{color}m
@oleksis
oleksis / Compile_wxPython_4.1.2a1_Python3.10_Windows.md
Last active January 7, 2023 23:09
Compile wxPython 4.1.2a1 using Microsoft C++ Build Tools 2019

Use case:

  • Windows 11 Dev Channel
  • GnuWin32: Make winget install -e --id GnuWin32.Make
  • Windows Subsystem for Linux 2
➜ wsl --version
WSL version: 0.50.2.0
Kernel version: 5.10.74.3
WSLg version: 1.0.29
Windows version: 10.0.22523.1000
@FleshMobProductions
FleshMobProductions / ReplaceSceneObjectsWithPrefabWindow.cs
Created July 14, 2021 15:41
Replace Scene Objects With Prefab (Unity Editor Tool) - Define filter criteria for objects to select, such as what attached component types they need to have or which tag they need to have, then replace them with a prefab instance of choice
using System.Collections.Generic;
using UnityEngine;
using UnityEditor;
using UnityEngine.SceneManagement;
using System.Linq;
namespace FMPUtils.Editor
{
public class ReplaceSceneObjectsWithPrefabWindow : EditorWindow
{
@idbrii
idbrii / ShakeIn2D.cs
Last active February 8, 2025 17:05
Unity camera shake 2d
// Released under CC0 and Unlicense
// Demo: https://imgur.com/a/9h3c6W5
// Screenshake should move the camera around smoothly but unpredictably. It
// shouldn't jitter the camera around in a way that makes it hard to follow
// what's on screen. That's why you should use continuous oscillating functions
// to produce your shake instead of random values. I also think it's useful to
// make a directional shake to help connect the shaking to the thing that
// caused it.
@manishtiwari25
manishtiwari25 / country_state.json
Last active June 13, 2025 06:23
List Of Countries With States And Other Useful Information, Updated On 06/01/2025 00:04:10
[
{
"name": "Andorra",
"countryCode": "AD",
"countryCodeAlpha3": "AND",
"phone": "376",
"currency": "EUR",
"flag": "https://www.geonames.org/flags/x/ad.gif",
"symbol": "\u20AC",
"stateProvinces": [
@Denbergvanthijs
Denbergvanthijs / donut.py
Last active June 10, 2025 09:08
3D spinning donut in Python. Based on the pseudocode from: https://www.a1k0n.net/2011/07/20/donut-math.html
import numpy as np
screen_size = 40
theta_spacing = 0.07
phi_spacing = 0.02
illumination = np.fromiter(".,-~:;=!*#$@", dtype="<U1")
A = 1
B = 1
R1 = 1
@dannguyen
dannguyen / fetch_ghstars.md
Last active April 24, 2025 10:07
fetch_ghstars.py: quick CLI script to fetch from Github API all of a user's starred repos and save it as raw JSON and wrangled CSV

fetch_ghstars.py: quick CLI script to fetch and collate from Github API all of a user's starred repos

  • Requires Python 3.6+
  • Creates a subdir 'ghstars-USERNAME' at the current working directory
  • the raw JSON of each page request is saved as: 01.json, 02.json 0n.json
  • A flattened, filtered CSV is also created: wrangled.csv

Example usage:

@PardhavMaradani
PardhavMaradani / 1_main.py
Last active April 11, 2022 10:37
Blog: Interactive Voronoi
# https://pardhav-m.blogspot.com/2020/07/interactive-voronoi.html
# https://trinket.io/embed/python/17e4c5d950
# Interactive Voronoi
# Voronoi Points
import turtle
from Voronoi import Voronoi
# seeds
g_seeds = []