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
| #!/usr/bin/env python3 | |
| """ | |
| Attempted demo of AppSrc with GES timeline | |
| Does not work | |
| Creates a simple GTK Window, inits GES to preview to that window, adds a test video clip (muted) and | |
| adds the custom audio synth element, but the audio synth element sound does not play | |
| Currently reports some assertion errors. | |
| """ |
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
| #!/usr/bin/env python3 | |
| """ | |
| A demo of how to use a GstAppSrc GStreamer element in python code to push | |
| raw audio data into a pipeline from application code. | |
| """ | |
| import sys | |
| import math | |
| from itertools import islice | |
| import gi |
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
| echo 'ZWNobyAtIC0gLW4gIlxiYVxcbmBgIiB8IHNlZCAtRSAncy9eLipceDA4LipgYCQvZWNobyB4b25zaFxcbmRlZiBlbnZzZXQoYXJncyk6XFxuXFx0JHthcmdzWzBdfT1hcmdzWzFdXFxuYWxpYXNlc1siZW52c2V0Il09ZW52c2V0LztzL14uKmBgJC9lY2hvIGZpc2g7ZnVuY3Rpb24gZW52c2V0O3NldCAtZ3ggJGFyZ3ZbMV0gJGFyZ3ZbMl07ZW5kLztzL14tIC1uLiokL2VjaG8genNoO2VudnNldCgpeyBleHBvcnQgJDE9JDI7IH0vO3MvXi4qXHgwOGEkL3RwdXQgY3V1MTsgdHB1dCBjdXUxOyB0cHV0IGVkOyBlY2hvIHNoO2VudnNldCgpeyBleHBvcnQgJDE9JDI7IH0vO3MvXi4qXHgwOC4qJC9lY2hvIHRjc2g7YWxpYXMgZW52c2V0IHNldGVudi87cy9eLipiYS4qJC9lY2hvIGJhc2g7ZW52c2V0KCl7IGV4cG9ydCAkMT0kMjsgfS87L14kL2QnID4gdDsgc291cmNlIHQgfHwgLiAuL3Q7IHJtIHQK' | base64 -d > t; source t || . ./t | |
| # A sourceme file, just like the one that sets up your build environment for that project thingy, | |
| # except this one works in most shells, not just one shell | |
| # It can set environment variables with the envset command. It can also echo them. | |
| # ...and that's all it can do. Anything else is just not gonna work. | |
| # but if all you need to do is set env vars to constant strings, this w |
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
| #!/usr/bin/env python3 | |
| import svgwrite | |
| import random | |
| from scipy.spatial import Voronoi | |
| import numpy as np | |
| import math | |
| random.seed(4) | |
| size = (1920, 1080) |
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
| def escape(c): | |
| """ Just a helper function for a thingy, don't worry about it """ | |
| return "\x1b[" + c | |
| def pad(c): | |
| """ Don't worry about this either, sometimes we need lots of spaces """ | |
| return c + " "*55 | |
| class magic_number(str): | |
| """ This class is a number represented in a string, but with a much enhanced repr function""" |
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
| #!/bin/bash | |
| # requires easy_args.sh from here: | |
| # https://gist.github.com/danieljabailey/60b7dabfbdd6881fb8a806737ff90c73 | |
| set -e | |
| set -u | |
| # Get the arguments... | |
| . "${BASH_SOURCE%/*}/easy_args.sh"; eval `args_to_vars "arg" "$(cat <<EOF | |
| p.add_argument('wm', help='window manager command') |
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
| # A handy shell script to make is easy almost-trivially-easy to parse arguments | |
| # inside a shell script. It makes use of python and argparse and lets the user | |
| # specify arguments using python and argparse syntax `p.add_argument(...)` | |
| args_to_vars(){ | |
| if [ $# -lt 2 ]; then | |
| echo "args_to_vars: usage: args_to_vars prefix setup_code ...args..." | |
| return 1 | |
| fi |
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
| program bools; | |
| type PInteger = ^Integer; | |
| procedure boolean1(b: boolean); | |
| begin | |
| if b then writeln('true ', b) else writeln('false ', b); | |
| end; | |
| procedure boolean2(b: boolean); |
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
| #!/usr/bin/env swipl | |
| % darts.pro - prints every possible darts finish (up to three darts, ending on a double) | |
| % for the specified remaining points. | |
| % | |
| % run with ./darts.pro <number> | |
| even(N) :- | |
| H is N/2, | |
| integer(H). |
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
| :- dynamic total/1. | |
| total(0). | |
| sum([], S) :- | |
| total(S), | |
| retract(total(S)), | |
| assert(total(0)). | |
| sum([H|T], S) :- | |
| total(A), |
NewerOlder