Skip to content

Instantly share code, notes, and snippets.

@ocomsoft
ocomsoft / main.py
Created August 31, 2017 23:16
Run Django in pywebview and CherryPy
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Inspired by https://gist.github.com/nigma/4349257 and https://github.com/r0x0r/pywebview/blob/master/examples/flask_app/src/backend/main.py
import os
import webbrowser
from time import sleep
import django
from threading import Timer, Thread
<?xml version="1.0" encoding="utf-8"?>
<ADLMCUSTOMENV VERSION="1.0.0.0">
<PLATFORM OS="Windows">
<KEY ID="ADLM_COMMON_BIN_LOCATION">
<!--Path to the AdLM shared executables-->
<STRING><path to maya netinstall>\adlm\R14\Program Files\Common Files\Autodesk Shared\Adlm\R14</STRING>
</KEY>
<KEY ID="ADLM_COMMON_LIB_LOCATION">
<!--Path to the AdLM shared libraries-->
<STRING><path to maya netinstall>\adlm\R14\Program Files\Common Files\Autodesk Shared\Adlm\R14</STRING>
@mikowl
mikowl / oneliners.js
Last active March 28, 2024 20:52
👑 Awesome one-liners you might find useful while coding.
// Inspired by https://twitter.com/coderitual/status/1112297299307384833 and https://tapajyoti-bose.medium.com/7-killer-one-liners-in-javascript-33db6798f5bf
// Remove any duplicates from an array of primitives.
const unique = [...new Set(arr)]
// Sleep in async functions. Use: await sleep(2000).
const sleep = (ms) => (new Promise(resolve => setTimeout(resolve, ms)));
// or
const sleep = util.promisify(setTimeout);
@premek
premek / mv.sh
Last active March 5, 2024 17:43
Rename files in linux / bash using mv command without typing the full name two times
# Put this function to your .bashrc file.
# Usage: mv oldfilename
# If you call mv without the second parameter it will prompt you to edit the filename on command line.
# Original mv is called when it's called with more than one argument.
# It's useful when you want to change just a few letters in a long name.
#
# Also see:
# - imv from renameutils
# - Ctrl-W Ctrl-Y Ctrl-Y (cut last word, paste, paste)
@bssrdf
bssrdf / blender_slow.md
Last active August 2, 2023 15:26
A curious case of O(N^2) behavior which should be O(N)

Motivation

Recently I got interested in Blender 3D, partly inspired by infinigen project.

One day I encountered Tellusim. Impressed by the quality of its rendering, I was browsing its blogs and see this. Wow, Tellusim really blowed others out of the water;others including Unreal, Unity, Omniverse and Blender. Wait, Blender is really that slow importing a USD scene?

Since Blender is open-source, why not try to figure out what's going on? Here we go.

First, let's profile it