Skip to content

Instantly share code, notes, and snippets.

@Celeborn2BeAlive
Celeborn2BeAlive / nodetest.py
Created February 21, 2020 13:53 — forked from OEP/nodetest.py
Basic script for Blender Python nodes
import bpy
from bpy.props import IntProperty, FloatProperty, PointerProperty
import nodeitems_utils
from nodeitems_utils import NodeItem, NodeCategory
bl_info = {
"name": "Custom nodes",
"category": "Node",
}
@Celeborn2BeAlive
Celeborn2BeAlive / msys2-visual-studio-code.md
Created October 21, 2019 11:22 — forked from dhkatz/msys2-visual-studio-code.md
Using MSYS2 with Visual Studio Code

Using MSYS2 with Visual Studio Code is extremely easy now thanks to the Shell Launcher extension by Tyriar.

First, install the extension and reload Visual Studio Code.

Then, open the settings.json to edit your settings.

Add the field shellLauncher.shells.windows. I recommend using autocompletion here so that all the default shells are added.

You should having something like this now:

Apply patch

By default:

git apply my_diff.diff

If it does not apply, then:

git apply --reject my_diff.diff
@Celeborn2BeAlive
Celeborn2BeAlive / python_cheat_sheet.md
Last active December 6, 2019 17:38
Python Cheat Sheet

Python Cheat Sheet

Creating a Virtual Environment

virtualenv venv
source venv/Scripts/activate

Then install packages and freeze them in a file:

@Celeborn2BeAlive
Celeborn2BeAlive / cycles-source-code.md
Last active June 11, 2019 15:02
Diving into Cycles source code

Diving into Cycles source code

This document describes my understanding of the Cycles renderer source code. Cycles is a unidirectional path tracer provided with Blender for production rendering. As a production renderer, its code favors performance and simplicity over generality. It can run on CPU or GPU, and the same kernel code can be compiled with a CPU compiler (gcc, msbuild) or a GPU compiler (cuda, OpenCL). To do that, the code tries to remain simple (mostly C code) but exploit macros to specialize some parts of the code.

In this document I focus on the CPU rendering. I compiled blender in "full" mode, meaning Cuda kernels are not compiled. One reason for that is Cuda kernel compilation seems quite expensive so if I want to change the code and quickly iterate, it might be hard. I may do another analysis for GPU part later but I doubt it would be very interesting since it is the same code.

@Celeborn2BeAlive
Celeborn2BeAlive / centos.install.boost.md
Created May 15, 2019 15:34 — forked from 1duo/centos.install.boost.md
Install Boost library from source on CentOS 7.

Download Boost Library: http://www.boost.org (Choose the expected version)

wget https://cfhcable.dl.sourceforge.net/project/boost/boost/1.54.0/boost_1_54_0.tar.gz
wget https://phoenixnap.dl.sourceforge.net/project/boost/boost/1.58.0/boost_1_58_0.tar.gz
wget https://dl.bintray.com/boostorg/release/1.64.0/source/boost_1_64_0.tar.gz
wget https://dl.bintray.com/boostorg/release/1.65.1/source/boost_1_65_1.tar.gz
wget https://dl.bintray.com/boostorg/release/1.67.0/source/boost_1_67_0.tar.gz
wget https://dl.bintray.com/boostorg/release/1.68.0/source/boost_1_68_0.tar.gz
wget https://dl.bintray.com/boostorg/release/1.69.0/source/boost_1_69_0.tar.gz
@Celeborn2BeAlive
Celeborn2BeAlive / better-nodejs-require-paths.md
Created April 15, 2019 15:57 — forked from branneman/better-nodejs-require-paths.md
Better local require() paths for Node.js

Better local require() paths for Node.js

Problem

When the directory structure of your Node.js application (not library!) has some depth, you end up with a lot of annoying relative paths in your require calls like:

const Article = require('../../../../app/models/article');

Those suck for maintenance and they're ugly.

Possible solutions

Effective Modern CMake

Getting Started

For a brief user-level introduction to CMake, watch C++ Weekly, Episode 78, Intro to CMake by Jason Turner. LLVM’s CMake Primer provides a good high-level introduction to the CMake syntax. Go read it now.

After that, watch Mathieu Ropert’s CppCon 2017 talk Using Modern CMake Patterns to Enforce a Good Modular Design (slides). It provides a thorough explanation of what modern CMake is and why it is so much better than “old school” CMake. The modular design ideas in this talk are based on the book [Large-Scale C++ Software Design](https://www.amazon.de/Large-Scale-Soft

Download CMake from: https://cmake.org/download/

wget https://cmake.org/files/v3.12/cmake-3.12.3.tar.gz

Compile from source and install

tar zxvf cmake-3.*
@Celeborn2BeAlive
Celeborn2BeAlive / getip.sh
Last active July 5, 2018 22:51
Shell function to get external IP address
getip() {
echo `curl http://checkip.dyndns.org 2> /dev/null | sed -nre 's/^.* (([0-9]{1,3}\.){3}[0-9]{1,3}).*$/\1/p'`
return 0
}
IP=`getip`