Skip to content

Instantly share code, notes, and snippets.

@portnov
portnov / Dockerfile
Last active July 23, 2016 19:38
Krita master appimage build
FROM centos:6.6
MAINTAINER Ilya Portnov <portnov@iportnov.ru>
ENV LC_ALL=en_US.UTF-8
ENV LANG=en_us.UTF-8
ENV LD_LIBRARY_PATH=/usr/lib64/:/usr/lib:/krita.appdir/usr/lib
RUN yum -y install epel-release && \
yum -y update && \
yum -y install wget tar bzip2 git libtool \
@portnov
portnov / Ridders.hs
Last active February 21, 2017 02:34
Ridders method
module Ridders where
import qualified Data.Map as M
import Control.Monad.State
type R = Double
ridders :: R -> R -> R -> (R -> R) -> Maybe R
ridders ε a b fn = evalState (go a b) M.empty
where
@portnov
portnov / habo.json
Created March 19, 2017 08:42
Mesh Expression JSON example
{
"vertices": [
[ -1.0, -1.0, -1.0 ],
[ -1.0, -1.0, "Center" ],
[ -1.0, 1.0, -1.0 ],
[ -1.0, 1.0, "Center" ],
[ 1.0, -1.0, -1.0 ],
[ 1.0, -1.0, "Low" ],
[ 1.0, 1.0, -1.0 ],
[ 1.0, 1.0, "Low" ],
@portnov
portnov / dodecahedron.json
Created March 19, 2017 12:26
Dodecahedron JSON
{
"vertices": [
[
0.5773502588272095,
0.5773502588272095,
0.5773502588272095
],
[
0.5773502588272095,
0.5773502588272095,
@portnov
portnov / VLC.hs
Created July 26, 2017 15:11
XMonad VLC integration via DBus
{-# LANGUAGE TemplateHaskell #-}
module VLC (toggleVlc) where
import XMonad
import DBus
import DBus.Client
import DBus.TH
interface "org.mpris.MediaPlayer2.vlc"
@portnov
portnov / Test1.hs
Created October 17, 2017 17:38
Data family export question
{-# LANGUAGE TypeFamilies #-}
module Test1
(ClassA (..)
) where
class ClassA a where
data DataA a
@portnov
portnov / sverchok.log
Created December 9, 2017 15:07
Profiler output
2017-12-09 20:01:00,275 [INFO] sverchok.utils.profile: Profiling results:
101074 function calls in 0.340 seconds
Ordered by: call count
ncalls tottime percall cumtime percall filename:lineno(function)
19828 0.006 0.000 0.006 0.000 {method 'get' of 'dict' objects}
13515 0.033 0.000 0.209 0.000 geom.py:485(eval_at_point)
6631 0.021 0.000 0.021 0.000 {built-in method numpy.core.multiarray.array}
5173 0.001 0.000 0.001 0.000 {built-in method builtins.len}
@portnov
portnov / crash.txt
Created December 9, 2017 15:57
Blender crash stack
# Blender 2.79 (sub 1), Commit date: 2017-12-02 16:35, Hash e1eb1fbfca
bpy.ops.node.new_node_tree() # Operator
bpy.data.node_groups["NodeTree"].io_panel_properties.io_options_enum = 'Import' # Property
bpy.data.node_groups["NodeTree"].io_panel_properties.gist_id = "cda35a4ae53012f63b7b61fdc035c990" # Property
bpy.ops.node.select(mouse_x=152, mouse_y=507, extend=False) # Operator
bpy.ops.node.delete() # Operator
# backtrace
./blender(BLI_system_backtrace+0x20) [0x1a86fd0]
./blender() [0x107d5f8]
@portnov
portnov / Scenario
Last active December 9, 2017 18:25
Script to crash blender
* Install that script as an addon
* In appeared panel (T panel in 3D view) press "Init text buffer"
* Press "Write some text"
* Press Ctrl-Z
* Presws "write some text" again
Result: blender crashes or hangs.
In file included from /usr/local/include/Vc/sse/intrinsics.h:53:0,
from /usr/local/include/Vc/sse/vector.h:33,
from /usr/local/include/Vc/vector.h:38,
from /usr/local/include/Vc/Vc:31,
from /home/portnov/SSD/src/krita/libs/pigment/compositeops/KoVcMultiArchBuildSupport.h:39,
from /home/portnov/SSD/src/krita/libs/pigment/compositeops/KoOptimizedCompositeOpFactoryPerArch.h:24,
from /home/portnov/SSD/src/krita/libs/pigment/compositeops/KoOptimizedCompositeOpFactory.cpp:20:
/usr/local/include/Vc/common/storage.h:190:21: error: flexible array member in union
EntryType m[];
^