Skip to content

Instantly share code, notes, and snippets.

View YiddishKop's full-sized avatar
🏠
Working from home

yiddishkop YiddishKop

🏠
Working from home
  • ZTE
  • NanJing
View GitHub Profile
@YiddishKop
YiddishKop / 00README.md
Created December 24, 2024 09:10 — forked from abul4fia/00README.md
Working with sections in manim

Working with sections in manim

Manim provides out of the box the possibility of marking parts of your scene as separate sections, by using self.next_section(). This will cause a separate video to be rendered for each section, and then all of them will be stitched together for the final result. The final result will be the same as if you hadn't used sections at all.

But the use of sections allows you to mark some of them with the parameter skip_animations=True, and in that case, that section will not be rendered. The code of the section will be run anyway (because it may be defining objects or variables needed in following sections), but for every self.play(), only the final frame will be computed (and not rendered). This ensures that, at the end of the section, all objects are at the same positions as if the animations were played, but skipping the actual rendering significantly reduces the time required to run the code.

In addition, the resulting video when skip_animations=True is used will be s

@YiddishKop
YiddishKop / timeline_of_animations.py
Created October 22, 2024 12:06 — forked from abul4fia/timeline_of_animations.py
Play animations in given timeline
from typing import Iterable
def play_timeline(scene, timeline):
"""
Plays a timeline of animations on a given scene.
Args:
scene (Scene): The scene to play the animations on.
timeline (dict): A dictionary where the keys are the times at which the animations should start,
and the values are the animations to play at that time. The values can be a single animation
@YiddishKop
YiddishKop / condaenv.txt
Created August 6, 2018 13:30 — forked from pratos/condaenv.txt
To package a conda environment (Requirement.txt and virtual environment)
# For Windows users# Note: <> denotes changes to be made
#Create a conda environment
conda create --name <environment-name> python=<version:2.7/3.5>
#To create a requirements.txt file:
conda list #Gives you list of packages used for the environment
conda list -e > requirements.txt #Save all the info about packages to your folder
@YiddishKop
YiddishKop / tmux-cheatsheet.markdown
Created May 13, 2018 23:03 — forked from ryerh/tmux-cheatsheet.markdown
Tmux 快捷键 & 速查表

Tmux 快捷键 & 速查表

启动新会话:

tmux [new -s 会话名 -n 窗口名]

恢复会话:

tmux at [-t 会话名]
@YiddishKop
YiddishKop / gtags_scala.md
Created May 6, 2018 11:55 — forked from icetan/gtags_scala.md
Set up ctags and scala support with GNU Global/Gtags

Basic Support

  1. Install ctags-exuberant
  2. Install gnu global
    • brew install global --with-exuberant-ctags
    • add the following lines in bash export GTAGSCONF=/usr/local/share/gtags/gtags.conf export GTAGSLABEL=ctags