This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import bpy | |
import random | |
import mathutils | |
def rnd(fromVal, toVal): | |
return random.randrange(fromVal, toVal) + random.random() | |
def ranVec(fromVal, toVal): | |
x = rnd(fromVal, toVal); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import bpy | |
cursorLoc = bpy.context.scene.cursor_location | |
# create camera at cursor | |
cam = bpy.data.cameras.new("Camera") | |
cam_ob = bpy.data.objects.new("Camera", cam) | |
cam_ob.location = cursorLoc | |
# add to default collection |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import bpy | |
import random | |
objects = bpy.context.selectable_objects; | |
cameras = [] | |
for obj in objects: | |
if type(obj.data) == bpy.types.Camera: | |
cameras.append(obj) | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const pathTypes = { | |
SIMPLE: 'ends_with_simple_attribute', | |
ARRAY: 'ends_with_array', | |
ARRAY_ITEM: 'ends_with_array_item', | |
ATTR_ON_ARRAY_ITEM: 'ends_with_attribute_on_array_item' | |
}; | |
function getPathType(path) { | |
let type; | |
if(/[[0-9]].[\w]*$/.test(path)) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Asynchronously loads a script | |
* A src with fallback/s, can be defined as an array of paths. | |
* | |
* @param src {String|Array<String>} the script to load | |
* @param containerEl {HTMLElement} element to append script tag | |
* @return {Promise} | |
*/ | |
const loadScript = ({ src, containerEl }) => { | |
let srcs; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
contents=''; for entry in ./*; do contents+=" $entry"; done; echo "$contents" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
str=''; for entry in ./*; do str+=" ./$entry"; done; echo "$str" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#get a list of all files in a directory with a recursive search. Show ful file path and file size in order of size | |
find . -type f -exec ls -lh {} \;| awk '{print $6, $10}' | sort -n |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
To use alternate credentials for a single operation, use the --username and --password switches for svn. | |
To clear previously-saved credentials, delete ~/.subversion/auth. You'll be prompted for credentials the next time they're needed. | |
These settings are saved in the user's home directory, so if you're using a shared account on "this laptop", be careful - if you allow the client to save your credentials, someone can impersonate you. The first option I provided is the better way to go in this case. At least until you stop using shared accounts on computers, which you shouldn't be doing. | |
To change credentials you need to do: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#dependencies | |
sudo apt-get install libttspico-utils | |
sudo apt-get install ffmpeg | |
#generate wav from text | |
pico2wave -w=out.wav -l=en-GB "Hello there" | |
#convert wav to mp3 | |
ffmpeg -i ./out.wav -b:a 160k -metadata artist=homebrook ./out.mp3 -y |