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 | |
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) | |
PARENT_DIR=$( dirname $SCRIPT_DIR ) |
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
const nReadlines = require("n-readlines"); | |
const fs = require("fs"); | |
const events = require('events'); | |
main().then(() => { | |
const used = process.memoryUsage().heapUsed / 1024 / 1024; | |
console.log( | |
`The script uses approximately ${Math.round(used * 100) / 100} MB` | |
); |
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
C:\Windows\system32\wsl.exe ssh %* |
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
export class BaseWorkerService<TaskInput, TaskOutput> { | |
private queue: QueueObject<TaskInput>; | |
private logger: Logger; | |
private workCounter = 0; | |
constructor( | |
workerName: string, | |
concurrency: number, | |
batchSize: number, | |
batchProcessor: (input: TaskInput[]) => Promise<TaskOutput[]>, |
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
const timeout_function = async (func, timeLimit) => { | |
return new Promise((resolve, reject) => { | |
const timer = setTimeout(() => { | |
console.log("Timeout reached"); | |
reject(null); | |
}, timeLimit); | |
const result = func(); | |
resolve(result); |
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 os | |
from TheFetchers.TheCommons import filename_check | |
with open(input('> '), 'r') as f: | |
files = [i.strip() for i in f.readlines()] | |
for file in files: | |
fn = os.path.splitext(file)[0]+'.mp4' | |
output_file = filename_check(fn, True) | |
cmd = "ffmpeg -i \"%s\" -vf scale=-2:480 -c:v libx264 \"%s\"" % (file, output_file) | |
os.system(cmd) |
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 origami | |
APP_TOKEN = "nongh::2113789:5001:8000:54.158.186.33" | |
app = origami.register(APP_TOKEN) | |
@origami.crossdomain | |
@app.listen() | |
def concat(): | |
allText = origami.getTextArray() |
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 | |
import tflearn | |
import numpy as np | |
import matplotlib.pyplot as plt | |
from scipy.stats import norm | |
import cv2 | |
import tflearn.datasets.mnist as mnist | |
trainX, trainY, testX, testY = mnist.load_data(one_hot=True) |
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 | |
import tflearn | |
import numpy as np | |
import matplotlib.pyplot as plt | |
from scipy.stats import norm | |
import tflearn.datasets.mnist as mnist | |
trainX, trainY, testX, testY = mnist.load_data(one_hot=True) | |
TENSORBOARD_DIR='./tmp/tflearn/vae' |
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 | |
import tflearn | |
import numpy as np | |
import matplotlib.pyplot as plt | |
from scipy.stats import norm | |
import tflearn.datasets.mnist as mnist | |
trainX, trainY, testX, testY = mnist.load_data(one_hot=True) | |
TENSORBOARD_DIR='./logs/vae' |
NewerOlder