Skip to content

Instantly share code, notes, and snippets.

View skrat's full-sized avatar

Dušan Maliarik skrat

View GitHub Profile
@skrat
skrat / watch.py
Created March 20, 2019 18:31
Auto reload file in blender using asyncio sleep
import os
import bpy
import asyncio
GLB = "/tmp/model.glb"
def import_gltf(path):
bpy.ops.object.select_all(action='SELECT')
bpy.ops.object.delete()
bpy.ops.import_scene.gltf(filepath=path)
cmake_minimum_required(VERSION 3.5)
project(jumper-qt LANGUAGES CXX)
set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(CMAKE_MODULE_PATH "${PROJECT_SOURCE_DIR}/modules/" ${CMAKE_MODULE_PATH})
set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_BINARY_DIR}/bin)
set(CMAKE_AUTOUIC ON)
set(CMAKE_AUTOMOC ON)
@skrat
skrat / getnifs.py
Last active April 16, 2020 20:10 — forked from chadmiller/getnifs.py
#!/usr/bin/python
# Based on https://gist.github.com/provegard/1536682, which was
# Based on getifaddrs.py from pydlnadms [http://code.google.com/p/pydlnadms/].
# Only tested on Linux!
from socket import AF_INET, AF_INET6, inet_ntop
from ctypes import (
Structure, Union, POINTER,
pointer, get_errno, cast,

Keybase proof

I hereby claim:

  • I am skrat on github.

  • I am skrat (https://keybase.io/skrat) on keybase.

  • I have a public key ASDvkkh_WzqaPYGA94ojnltZrn_OadNqiyFdd5-IB12T_Ao

@skrat
skrat / gist:3181775
Created July 26, 2012 12:34
Backbone.Model getters/setter for default attributes
/**
* Defines getter/setter properties using Backbone.Model defaults
* @param {Function} ctor constructor of Bakcbone.Model
*/
function defaultProperties(ctor) {
if (!ctor.prototype.defaults)
return;
var defattr = function(name) {
Object.defineProperty(ctor.prototype, name, {
get: function() {
(ns skrat.sketch-002.filament)
(def ^:dynamic *engine* nil)
(defn mat4
"Create new mat4"
[]
(. js/mat4 (create)))
(def VertexAttribute
diff --git a/PKGBUILD b/PKGBUILD
index 21805bc..10c053f 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -9,7 +9,7 @@ pkgdesc='A command line interface for the Pirate Bay'
arch=('any')
url='https://github.com/vikstrous/pirate-get/'
license=('AGPL')
-depends=('python' 'python-setuptools')
+depends=('python' 'python-setuptools' 'python-veryprettytable' 'python-beautifulsoup4')
(defn wall-top [c]
(vary-meta
(rt/material
(rt/->FlatFill
(color/int->color c)))
assoc :rsws-constant c))
@skrat
skrat / test.cljs
Last active June 16, 2017 13:14 — forked from Frozenlock/test.cljs
;; some speed tests of functions to access nested properties in JS objects.
(def test-data (->> (into {} (for [k1 (range 10)]
[k1 (into {} (for [k2 (range 10)]
[k2 (into {} (for [k3 (range 10)]
[k3 k3]))]))]))
(clj->js)))
(js/console.log
(.toString
(fn [x] (apply aget x ["foo" "bar" "baz"]))))
(js/console.log
(.toString
(fn [x] (aget x "foo" "bar" "baz"))))