Skip to content

Instantly share code, notes, and snippets.

@boredstiff
boredstiff / raspbian-python3.6.rst
Created January 14, 2018 21:15 — forked from dschep/raspbian-python3.6.rst
Installing Python 3.6 on Raspbian

Installing Python 3.6 on Raspbian

As of January 2017, Raspbian does not yet include the latest Python release, Python 3.6. This means we will have to build it ourselves, and here is how to do it.

  1. Install the required build-tools (some might already be installed on your system).
@boredstiff
boredstiff / reuse_options.py
Last active May 17, 2018 23:54
Click reusing options and chaining commands
"""This allows you to reuse options between commands and call one command to call two other commands.
So when 'create' is called, 'create_package' and 'create_repo' will be called and 'create_package' and 'create_repo'
can be called individually.
"""
import click
PACKAGE_NAME_KEY = __name__ + '.package_name'
REPO_NAME_KEY = __name__ + '.repo_name'
"""
no Get the midpoint of the locators.
no Get a vector from that point to each locator, and to the camera.
no The mid-to-front vector dotted with mid to camera vector will be greater than 0
1.) Get the world position (MPoint) of the front and back locators
2.) Get the vector from back to front. This will be your Z vector for the matrix
3.) Cross this vector with the world up vector (world Y) to get your X vector
4.) Cross your X and Z vectors to get an orthogonal Y vector
5.) Build a matrix with these component vectors and the position of your camera
@boredstiff
boredstiff / get_time_slider_widget.py
Created August 24, 2018 19:00
Get the Time Slider Widget in Maya
from maya import mel
from PySide2 import QtWidgets
def get_widget(name):
"""Get the widget from the active QApplication that matches the given name.
Args:
name (str): The name of the widget to retrieve.
Returns:
@boredstiff
boredstiff / view.py
Last active October 11, 2018 04:31
UI Movable data in MVC
import sys
from PySide2 import QtCore, QtWidgets, QtGui
class Node(QtGui.QStandardItem):
def __init__(self):
super(Node, self).__init__()
self.name = 'My name'
Step 16/17 : RUN cd /root/docs && cargo run -- database init
---> Running in cd87a7f3a657
Compiling cratesfyi v0.6.0 (/root/docs)
Finished dev [unoptimized + debuginfo] target(s) in 15.93s
Running `target/debug/cratesfyi database init`
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Error(Io(Os { code: 99, kind: AddrNotAvailable, message: "Cannot assign requested address" }))', src/libcore/result.rs:1009:5
stack backtrace:
0: std::sys::unix::backtrace::tracing::imp::unwind_backtrace
at src/libstd/sys/unix/backtrace/tracing/gcc_s.rs:49
1: std::sys_common::backtrace::_print
@boredstiff
boredstiff / blahhhh.py
Created February 26, 2019 20:57
sg_rest_question.py
sg.update('CustomNonProjectEntity02',
12345,
{'field_a': ['short', 'list'],
'field_b': ['different', 'list']
},
multi_entity_update_modes={
'field_a': 'set',
'field_b': 'add'
})
@boredstiff
boredstiff / blah.md
Created September 29, 2021 02:51
Bitwig -> Arturia Microfreak Sync

On the Microfreak:

  • Press the Utility button
    • Go to Sync
      • Source: Auto
      • Clock: 24PPQ
      • Global Tempo: off