Skip to content

Instantly share code, notes, and snippets.

Jiri Hnidek jirihnidek

Block or report user

Report or block jirihnidek

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View CMakeLists.txt
CMAKE_MINIMUM_REQUIRED (VERSION 3.11.2)
project(example C)
include(GNUInstallDirs)
set(CMAKE_C_STANDARD_REQUIRED ON)
set(CMAKE_C_STANDARD 11)
# Build type
@jirihnidek
jirihnidek / client_multi_process.py
Created May 29, 2018
Multi-threaded vs multi-process vs serial https client
View client_multi_process.py
#!/usr/bin/env python
import requests
import time
import copy
from multiprocessing import Process
from data import URLS
def send_request(num, url):
@jirihnidek
jirihnidek / example_res_reset.py
Created May 29, 2017
Example of reseting resolver using D-Bus, NetworkManager and ctypes
View example_res_reset.py
from __future__ import print_function
import dbus
import dbus.mainloop.glib
from gi.repository import GLib
import threading
import time
import socket
import ctypes
try:
@jirihnidek
jirihnidek / getaddrinfo_example.c
Last active May 27, 2019
Example of getaddrinfo() program.
View getaddrinfo_example.c
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <netdb.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <arpa/inet.h>
int
lookup_host (const char *host)
@jirihnidek
jirihnidek / CMakeLists.txt
Created Nov 25, 2016
Test of threads at Linux
View CMakeLists.txt
# Main CMakeFile.txt
# Minimal version of CMake
cmake_minimum_required (VERSION 2.6)
# Build type
if (NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
message(STATUS "Setting build type to 'Debug' as none was specified.")
set(CMAKE_BUILD_TYPE Debug CACHE STRING "Choose the type of build." FORCE)
# Set the possible values of build type for cmake-gui
@jirihnidek
jirihnidek / CMakeLists.txt
Last active Nov 29, 2016
Test of forking (creating lot of child processes) at Linux
View CMakeLists.txt
# Main CMakeFile.txt
# Minimal version of CMake
cmake_minimum_required (VERSION 2.6)
# Build type
if (NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
message(STATUS "Setting build type to 'Debug' as none was specified.")
set(CMAKE_BUILD_TYPE Debug CACHE STRING "Choose the type of build." FORCE)
# Set the possible values of build type for cmake-gui
@jirihnidek
jirihnidek / bspline_solid-boolean.py
Created Nov 9, 2016
Example of solid boolean operation
View bspline_solid-boolean.py
"""
This module is able to create simple solid object (cube). Each side of
cube is bspline surface. This solid object can be exported to BREP file.
"""
from OCC.gp import *
from OCC.Geom import *
from OCC.TColGeom import *
from OCC.TColgp import *
from OCC.GeomConvert import *
@jirihnidek
jirihnidek / simple_webgl.html
Last active Nov 7, 2016
Simple example of WebGL
View simple_webgl.html
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8"/>
<title>WebGL Simple Point</title>
</head>
<body>
<canvas width="512" height="512" id="webgl_canvas"></canvas>
@jirihnidek
jirihnidek / bmesh_shape_keys.py
Created Sep 15, 2016
Simple Blender Python script demonstrating using BMesh and Shape Keys
View bmesh_shape_keys.py
import bpy
import bmesh
import mathutils
def main():
"""
Example of bmesh and shape keys
"""
# Add basis shape
@jirihnidek
jirihnidek / blender_img_3d_background.py
Last active Sep 16, 2016
This is simple Blender Python script for setting 3D background empty object.
View blender_img_3d_background.py
"""
This example try to create new empty object visualized as
image. Image fits to the background of current active camera.
When you set X,Y coordinates of empty object called 'Pixel',
then this object is position at corresponding X,Y coordinate
at image in 3D space.
"""
import bpy
import math
You can’t perform that action at this time.