Skip to content

Instantly share code, notes, and snippets.

View sadielbartholomew's full-sized avatar
🐢
🐢 ♾️ ⬇️

Sadie L. Bartholomew sadielbartholomew

🐢
🐢 ♾️ ⬇️
View GitHub Profile
// by dave @beesandbombs :)
float[][] result;
float t, c;
float ease(float p) {
p = c01(p);
return 3*p*p - 2*p*p*p;
}
@fogleman
fogleman / snowflake.py
Last active December 28, 2021 00:21
Snowflake Generator
import random
import time
# inspiration: https://mathematica.stackexchange.com/questions/39361/how-to-generate-a-random-snowflake
# see https://www.redblobgames.com/grids/hexagons/ for information
# about hexagon grids and coordinate systems
# neighbors in axial coordinates
DIRS = [(1, 0), (1, -1), (0, -1), (-1, 0), (-1, 1), (0, 1)]
@tonibardina
tonibardina / std.md
Created December 16, 2020 09:24 — forked from turbo/std.md
Git Commit Message Standard

Merged from https://github.com/joelparkerhenderson/git_commit_message and https://chris.beams.io/posts/git-commit/

General Rules

  • Commit messages must have a subject line and may have body copy. These must be separated by a blank line.
  • The subject line must not exceed 50 characters
  • The subject line should be capitalized and must not end in a period
  • The subject line must be written in imperative mood (Fix, not Fixed / Fixes etc.)
  • The body copy must be wrapped at 72 columns
  • The body copy must only contain explanations as to what and why, never how. The latter belongs in documentation and implementation.
@bnlawrence
bnlawrence / mpi_v_example.py
Last active December 28, 2023 10:29
example of using mpi alltoall and alltoallv
from mpi4py import MPI
import numpy as np
comm = MPI.COMM_WORLD
rank = comm.Get_rank()
nprocs = comm.Get_size()
DEBUG = 0
def move_info(info2move):
@JamesPHoughton
JamesPHoughton / rotate_label.md
Last active June 26, 2024 21:33
How to create rotary labels in networkx circular layout
g = nx.complete_graph([
    "playground equipment", "evanescent champagne", "curved spacetime", 
    "magic flute", "market returns", "spotty memory",
    "languid feeling", "include numpy as np", "acidic chemical", 
    "downton abbey", "tumble weeds", "precede the cause"])
node_locs = nx.circular_layout(g)
theta = {k: np.arctan2(v[1], v[0]) * 180/np.pi for k, v in node_locs.items() }
@barraponto
barraponto / git-submodule-rm.sh
Created April 25, 2012 16:36
git submodule-rm
#!/bin/bash
function actual_path() {
if [ [ -z "$1" ] -a [ -d $1 ] ]; then
echo $(cd $1 && test `pwd` = `pwd -P`)
return 0
else
return 1
fi
}