- Install ffmpeg.
brew install ffmpeg
- Figure out which device to use.
ffmpeg -f avfoundation -list_devices true -i ""
Ouput will look like:
/* | |
This small patch is an example of how to nicely send midi to Ableton Live from SuperCollider. | |
It includes how to set up Ableton Link (don't forget to press the "LINK" button in Live) and play a pattern using Link and midi. | |
It is assumed that you do this on MacOS and you have created a midi driver called "IAC Driver". | |
*/ | |
( |
#Download deb file from : | |
# https://developer.nvidia.com/compute/machine-learning/cudnn/secure/v7.5.0.56/prod/10.1_20190225/Ubuntu14_04-x64/libcudnn7_7.5.0.56-1%2Bcuda10.1_amd64.deb | |
# https://developer.nvidia.com/compute/machine-learning/cudnn/secure/v7.5.0.56/prod/10.1_20190225/Ubuntu14_04-x64/libcudnn7-dev_7.5.0.56-1%2Bcuda10.1_amd64.deb | |
sudo dpkg -i libcudnn7_7.5.0.56-1+cuda10.1_amd64.deb | |
sudo dpkg -i libcudnn7-dev_7.5.0.56-1+cuda10.1_amd64.deb |
# | |
# Make `pp` use IPython's pretty printer, instead of the standard `pprint` module. | |
# | |
# Sources: https://nedbatchelder.com/blog/200704/my_pdbrc.html | |
# | |
# XXX: This .pdbrc is only valid for Python >= 3.4 | |
# | |
import pdb | |
import inspect as __inspect | |
from pprint import pprint as __pprint |
#include <mach-o/dyld.h> | |
char *target_image_name = "libdyld"; | |
const struct mach_header* target_mach_header = NULL; | |
const char *image_name = NULL; | |
int num_images = _dyld_image_count(); | |
printf("%i images loaded\n", num_images); | |
for (int i = 0; i < num_images; i++) { |
This is a compiled list of falsehoods programmers tend to believe about working with time.
Don't re-invent a date time library yourself. If you think you understand everything about time, you're probably doing it wrong.
# An example to get the remaining rate limit using the Github GraphQL API. | |
import requests | |
headers = {"Authorization": "Bearer YOUR API KEY"} | |
def run_query(query): # A simple function to use requests.post to make the API call. Note the json= section. | |
request = requests.post('https://api.github.com/graphql', json={'query': query}, headers=headers) | |
if request.status_code == 200: |
from __future__ import print_function | |
try: | |
import msvcrt | |
def key_pressed(): | |
return msvcrt.kbhit() | |
def read_key(): | |
key = msvcrt.getch() |
import hashlib | |
from functools import wraps | |
from django.core.cache import cache | |
from django.utils.encoding import force_text, force_bytes | |
def cache_memoize( | |
timeout, | |
prefix='', |
package main | |
import ( | |
"strings" | |
) | |
func main() { | |
strings.HasPrefix("foobar", "foo") // true | |
} |