Skip to content

Instantly share code, notes, and snippets.

View Gholamrezadar's full-sized avatar
💤

Gholamreza Dar Gholamrezadar

💤
View GitHub Profile
@abul4fia
abul4fia / ligth_theme.py
Last active May 8, 2025 22:19
Light theme for manim
# Put this file in the same folder than your manim script
# and start your script with:
#
# import light_theme
from manim import *
config.background_color = WHITE
# Those are objects which are WHITE by default
@Airyzz
Airyzz / sphere_packing.py
Created September 5, 2020 06:42
Blender Sphere Packing Generator
import bpy
from mathutils import *
import random
rad = 5
numSpheres = 5000
resolution = 0.1
spheres = list()
def dist(point1, point2):
@companje
companje / map.glsl
Created January 23, 2018 22:46
map() function for GLSL known from Processing & openFrameworks
float map(float value, float min1, float max1, float min2, float max2) {
return min2 + (value - min1) * (max2 - min2) / (max1 - min1);
}
@msrose
msrose / combining-git-repositories.md
Last active May 20, 2025 14:44
How to combine two git repositories.

Combining two git repositories

Use case: You have repository A with remote location rA, and repository B (which may or may not have remote location rB). You want to do one of two things:

  • preserve all commits of both repositories, but replace everything from A with the contents of B, and use rA as your remote location
  • actually combine the two repositories, as if they are two branches that you want to merge, using rA as the remote location

NB: Check out git subtree/git submodule and this Stack Overflow question before going through the steps below. This gist is just a record of how I solved this problem on my own one day.

Before starting, make sure your local and remote repositories are up-to-date with all changes you need. The following steps use the general idea of changing the remote origin and renaming the local master branch of one of the repos in order to combine the two master branches.