This file contains 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 | |
INPUT_DIR="." | |
INPUT_FILE_EXTENSION=".flac" | |
BITRATE="320k" | |
OUTPUT_DIR="MP3" | |
OUTPUT_FILE_EXTENSION=".mp3" | |
N_PARALLEL=4 | |
find "$INPUT_DIR" -print0 | xargs -0 -n 1 -P $N_PARALLEL sh -c 'ffmpeg -i "$1" -ab $BITRATE "$OUTPUT_DIR/${1%$INPUT_FILE_EXTENSION}$OUTPUT_FILE_EXTENSION"' sh |
This file contains 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 random | |
import numpy as np | |
from shapely.geometry import Point | |
from shapely.geometry.polygon import Polygon | |
points = [ | |
[0, 0], | |
[0, 1], | |
[1, 0], | |
[1, 1] |
This file contains 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
// Credit goes to https://github.com/yeoman/generator-chrome-extension | |
// Reload client for Chrome Apps & Extensions. | |
// The reload client has a compatibility with livereload. | |
// WARNING: only supports reload command. | |
var LIVERELOAD_HOST = 'localhost:'; | |
var LIVERELOAD_PORT = 35729; | |
var connection = new WebSocket('ws://' + LIVERELOAD_HOST + LIVERELOAD_PORT + '/livereload'); | |
connection.onerror = function (error) { |
This file contains 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 tensorflow as tf | |
## Tensorflow image translation op | |
# images: A tensor of shape (num_images, num_rows, num_columns, num_channels) (NHWC), | |
# (num_rows, num_columns, num_channels) (HWC), or (num_rows, num_columns) (HW). | |
# tx: The translation in the x direction. | |
# ty: The translation in the y direction. | |
# interpolation: If x or y are not integers, interpolation comes into play. Options are 'NEAREST' or 'BILINEAR' | |
def tf_image_translate(images, tx, ty, interpolation='NEAREST'): | |
# got these parameters from solving the equations for pixel translations |
This file contains 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 | |
# assuming convert.sh is in the folder you want the new images to be in, | |
# and the source images are one level up, then run with: | |
# ./convert.sh ../*.{JPG,jpg} | |
# each copy shows for about 5 seconds, so 120 copies is about 6 minutes per slide | |
copies=120 | |
# my external monitor is 2560x1440. change this as needed for full-bleed images |
This file contains 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 | |
# assuming convert.sh is in the folder you want the new images to be in, | |
# and the source images are one level up, then run with: | |
# ./convert_for_screensaver.sh ../*.{JPG,jpg} | |
# each copy shows for about 5 seconds, so 120 copies is about 6 minutes per slide | |
copies=120 | |
num=1 |
This file contains 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 kotlin.system.measureTimeMillis | |
fun test_permutations() { | |
val list = listOf<Int>(1, 2, 3) | |
val truth_permutations = listOf<List<Int>>( | |
listOf<Int>(1, 2, 3), | |
listOf<Int>(2, 1, 3), | |
listOf<Int>(3, 1, 2), | |
listOf<Int>(1, 3, 2), | |
listOf<Int>(2, 3, 1), |