Skip to content

Instantly share code, notes, and snippets.

View niittymaa's full-sized avatar

Sakari Niittymaa niittymaa

View GitHub Profile
@SuddenDevelopment
SuddenDevelopment / subPanel.py
Created September 11, 2021 03:09
Blender addon UI create collapsible subpanel
import bpy
class EXAMPLE_panel:
bl_space_type = "VIEW_3D"
bl_region_type = "UI"
bl_category = "Hi"
bl_options = {"DEFAULT_CLOSED"}
#The primary panel, no parents
class EXAMPLE_PT_panel_1(EXAMPLE_panel, bpy.types.Panel):
@coderofsalvation
coderofsalvation / playaudio.ps1
Created October 28, 2020 10:16
hasslefree playing mp3 wav audio in Windows 10 WSL
#!/mnt/c/Windows/System32/WindowsPowerShell/v1.0/powershell.exe -noexit
# Play a single file
# Usage:
# LINUX: timeout 5 ./playaudio.ps1 "c:\Users\Leon\Downloads\bensound-allthat.mp3" &>/dev/null &
# CMD.EXE: powershell.exe -noexit ./playaudio.ps1 "c:\Users\Leon\Downloads\bensound-allthat.mp3"
Add-Type -AssemblyName presentationCore
$mediaPlayer = New-Object system.windows.media.mediaplayer
$mediaPlayer.open( $args[0] )
$mediaPlayer.Play()
@yankiara
yankiara / oxygen-repeater-dynamic-query.php
Last active July 15, 2024 15:17
Use dynamic queries with Oxygen's repeater
/* I'll put here different examples of dynamic query for Oxygen repeater :
* - Use one of the following repeater_dynamic_query definitions
* in code block just BEFORE the repeater
* - Set the repeater custom query settings : post type, number of posts, order...
* - Add the remove_action in a code block AFTER the repeater
*/
/****************************************************************************************************
* Display related posts for any CPT with taxonomy:
@StevenACoffman
StevenACoffman / Homoglyphs.md
Last active November 12, 2024 22:09
Unicode Look-alikes

Unicode Character Look-Alikes

Original Letter Look-Alike(s)
a а ạ ą ä à á ą
c с ƈ ċ
d ԁ ɗ
e е ẹ ė é è
g ġ
h һ
@p2or
p2or / Blender_Basic-UI-Template.py
Last active September 23, 2024 15:48
Basic-UI-Template (Blender 3+) for https://blender.stackexchange.com/a/57332 #Blender
# ##### BEGIN GPL LICENSE BLOCK #####
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
@lamyj
lamyj / wp
Last active February 20, 2024 22:35
Convert between Windows path and Linux path in WSL
#!/usr/bin/env python
from __future__ import print_function
import argparse
import json
import re
import subprocess
import sys
@kauffmanes
kauffmanes / install_anaconda.md
Last active November 7, 2024 06:50
Install Anaconda on Windows Subsystem for Linux (WSL)

Thanks everyone for commenting/contributing! I made this in college for a class and I no longer really use the technology. I encourage you all to help each other, but I probably won't be answering questions anymore.

This article is also on my blog: https://emilykauffman.com/blog/install-anaconda-on-wsl

Note: $ denotes the start of a command. Don't actually type this.

Steps to Install Anaconda on Windows Ubuntu Terminal

  1. Install WSL (Ubuntu for Windows - can be found in Windows Store). I recommend the latest version (I'm using 18.04) because there are some bugs they worked out during 14/16 (microsoft/WSL#785)
  2. Go to https://repo.continuum.io/archive to find the list of Anaconda releases
  3. Select the release you want. I have a 64-bit computer, so I chose the latest release ending in x86_64.sh. If I had a 32-bit computer, I'd select the x86.sh version. If you accidentally try to install the wrong one, you'll get a warning in the terminal. I chose `Anaconda3-5.2.0-Li
# ##### BEGIN GPL LICENSE BLOCK #####
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
using UnityEngine;
public class DistanceJoint3D : MonoBehaviour {
public Transform ConnectedRigidbody;
public bool DetermineDistanceOnStart = true;
public float Distance;
public float Spring = 0.1f;
public float Damper = 5f;
@ForgottenUmbrella
ForgottenUmbrella / publish_python.md
Last active September 24, 2024 10:14
How to publish Python apps for human beings

How to publish Python apps for human beings

So, you've created a Python app (be it a graphical user interface with Qt or the like, or a simple command line interface). Great! But how are others going to use it? Python applications often have dependencies (e.g. from third-party modules), and they also need a Python interpreter to run them. For a developer, installing all the necessary bits and bobs to make things work is okay, but that's unacceptable for a normal user - they just want to download the thing and run it.

Below are simple instructions to publish your app on the three main operating systems: Windows, macOS and Linux.