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 |
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.
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
using System.Collections.Generic; | |
using UnityEngine; | |
using UnityEditor; | |
using UnityEngine.SceneManagement; | |
using System.Linq; | |
namespace FMPUtils.Editor | |
{ | |
public class ReplaceSceneObjectsWithPrefabWindow : EditorWindow | |
{ |
// 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. |
[ | |
{ | |
"name": "Andorra", | |
"countryCode": "AD", | |
"countryCodeAlpha3": "AND", | |
"phone": "376", | |
"currency": "EUR", | |
"flag": "https://www.geonames.org/flags/x/ad.gif", | |
"symbol": "\u20AC", | |
"stateProvinces": [ |
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 |
wrangled.csv
Example usage:
# 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 = [] |