Skip to content

Instantly share code, notes, and snippets.

View jirihnidek's full-sized avatar

Jiri Hnidek jirihnidek

View GitHub Profile
"""
This simple example of Blender Python script prints membership of verticies in vertex groups and weights. It uses deform layer.
"""
import bpy
import bmesh
obj = bpy.context.object
# Get the active mesh
#!/usr/bin/env python
"""
Simple example of bspline surface created directly (not using Bezier surface)
"""
from OCC.gp import *
from OCC.Geom import *
from OCC.TColGeom import *
from OCC.TColgp import *
@jirihnidek
jirihnidek / webpy_json.py
Last active August 29, 2015 14:08
WebPy JSON Example
"""
This module tries to print JSON from HTTP GET/POST method.
"""
#
# To test the application run application with:
#
# python ./webpy_json.py
#
# and type following URI in browser addres bar:
@jirihnidek
jirihnidek / README.md
Last active August 29, 2015 14:03
Examples of Python scripts for adding and changing values in Verse layers

Examples of VerseLayer

This gist contains several Python scripts using class VerseLayer from module Verse Entities: https://github.com/verse/verse-entities

Create Verse Layer

The script that is used for creating new layer is called verse_layer_create.py. This script creates new Node, then this node is moved to the parent of scene nodes. Thus this node will not be destroyed after client logout. New layer is created in

@jirihnidek
jirihnidek / .gitignore
Last active November 17, 2022 20:04
UDP client-server application using random port number with respect to statefull firewalls aka hole punching.
.cproject
.project
@jirivrany
jirivrany / Hash
Last active August 29, 2015 13:56
Python - map vs. list generator
'''
@author: Jiri Vrany
'''
import hashlib
def hash_word(word):
'''
returns sha512 hash
'''
@jirihnidek
jirihnidek / Results.md
Last active August 29, 2015 13:56
Simple CTypes example and benchmark.

Results of Benchmark

Python2.6         0.14
Python2.6 CTypes  0.71
Python2.7         0.15
Python2.7 CTypes  0.77
Python3.3         0.14
Python3.3 CTypes 0.71
@jirihnidek
jirihnidek / multi_proc.py
Last active August 29, 2015 13:56
Testing of multithreading and multiprocesing in Python interpreters.
#!/usr/bin/env python
"""
Simple module for testing parallel variant of
code using Python multiprocessing
"""
from multiprocessing import Process
import time
@qguv
qguv / solarized-dark.css
Last active April 5, 2021 04:50 — forked from nicolashery/solarized-dark.css
Solarized theme for Jekyll, updated to reflect toned-down line numbers
/* Solarized Dark
For use with Jekyll and Pygments
http://ethanschoonover.com/solarized
SOLARIZED HEX ROLE
--------- -------- ------------------------------------------
base03 #002b36 background
base01 #586e75 comments / secondary content
@caspian311
caspian311 / client.py
Created January 30, 2013 19:36
Simple client-service dbus example in python.
#!/usr/bin/env python
import dbus
class Client():
def __init__(self):
bus = dbus.SessionBus()
service = bus.get_object('com.example.service', "/com/example/service")
self._message = service.get_dbus_method('get_message', 'com.example.service.Message')
self._quit = service.get_dbus_method('quit', 'com.example.service.Quit')