Skip to content

Instantly share code, notes, and snippets.

View generic-github-user's full-sized avatar
📚
fervently skimming arXiv

Anna Allen generic-github-user

📚
fervently skimming arXiv
  • United States
View GitHub Profile

ZSH CheatSheet

This is a cheat sheet for how to perform various actions to ZSH, which can be tricky to find on the web as the syntax is not intuitive and it is generally not very well-documented.

Strings

Description Syntax
Get the length of a string ${#VARNAME}
Get a single character ${VARNAME[index]}
@timdrichards
timdrichards / cheat_sheet.txt
Created January 26, 2021 14:32
GDB cheat sheet
GDB commands by function - simple guide
---------------------------------------
More important commands have a (*) by them.
Startup
% gdb -help print startup help, show switches
*% gdb object normal debug
*% gdb object core core debug (must specify core file)
%% gdb object pid attach to running process
% gdb use file command to load object
@John-Paul-R
John-Paul-R / FabricModList.md
Last active April 18, 2025 14:45
A list of (almost all) mods for Fabric

Fabric Mod List

This page contains a list of the current Minecraft Fabric mods. (As of 2021-08-19 08:05:23 Timezone: UTC+0000 (GMT))

To search for mods by name, category, or download count, visit the website, fibermc.com!

Note: You can view a mod's source files by following the "Source" link on its CurseForge page, assuming that the mod's creator has made such files public.

There are currently 2954 mods in this list.

@mrunkel
mrunkel / zfs_cheatsheet.md
Last active October 17, 2024 15:31
My ZFS cheatsheet

ZFS commands cheatsheet

Devices and Pools

List all devices in the server

lsblk -S

List all pools

zpool list

@quadrismegistus
quadrismegistus / pyvis_for_networkx.py
Last active July 20, 2023 12:59
Draw Networkx Graph with Pyvis
def draw_graph3(networkx_graph,notebook=True,output_filename='graph.html',show_buttons=True,only_physics_buttons=False):
"""
This function accepts a networkx graph object,
converts it to a pyvis network object preserving its node and edge attributes,
and both returns and saves a dynamic network visualization.
Valid node attributes include:
"size", "value", "title", "x", "y", "label", "color".
(For more info: https://pyvis.readthedocs.io/en/latest/documentation.html#pyvis.network.Network.add_node)
@fnky
fnky / ANSI.md
Last active April 19, 2025 15:50
ANSI Escape Codes

ANSI Escape Sequences

Standard escape codes are prefixed with Escape:

  • Ctrl-Key: ^[
  • Octal: \033
  • Unicode: \u001b
  • Hexadecimal: \x1B
  • Decimal: 27
@qpwo
qpwo / monte_carlo_tree_search.py
Last active April 13, 2025 01:41
Monte Carlo tree search (MCTS) minimal implementation in Python 3, with a tic-tac-toe example gameplay
"""
A minimal implementation of Monte Carlo tree search (MCTS) in Python 3
Luke Harold Miles, July 2019, Public Domain Dedication
See also https://en.wikipedia.org/wiki/Monte_Carlo_tree_search
https://gist.github.com/qpwo/c538c6f73727e254fdc7fab81024f6e1
"""
from abc import ABC, abstractmethod
from collections import defaultdict
import math
@noahcoad
noahcoad / readme.md
Last active April 18, 2025 21:50
Code Minecraft with Python on Mac OSX

Code Minecraft with Python on Mac OSX

Here's a step-by-step to get started scripting Minecraft with Python on Mac OSX

@fomightez
fomightez / useful_notebook_snippets
Last active December 20, 2024 21:19
Useful snippets for Jupyter notebooks
# Use `%%capture` to hush 'noisy' stdout and stderr streams, but still combine with getting `%%time` after
%%capture out_stream
%%time
---rest of a cell that does something with LOTS of output--
#In cell after, put following to get time of completion from that:
#time it took to run cell above
for x in out_stream.stdout.split("\n")[-3:]:
print(x)
@tehZevo
tehZevo / tfjs-example.js
Last active September 15, 2018 19:06
An example solving XOR problem with tfjs
var tf = require("@tensorflow/tfjs");
//code modified from:
//https://medium.com/tensorflow/a-gentle-introduction-to-tensorflow-js-dba2e5257702
//define our inputs (combinations of 2 bits, represented as 0s and 1s)
//https://js.tensorflow.org/api/0.12.0/#tensor
var xs = tf.tensor([[0, 0], [0, 1], [1, 0], [1, 1]]);
//define our outputs (xor operation, a simple non-linear problem)