Skip to content

Instantly share code, notes, and snippets.

View cceyda's full-sized avatar
:octocat:

Ceyda Cinarel (재이다) cceyda

:octocat:
View GitHub Profile
@cceyda
cceyda / main.py
Created December 4, 2023 09:40 — forked from Oceanswave/main.py
Streaming Transcriber w/ Whisper v3
#! python3.7
import argparse
import io
import os
import torch
from transformers import pipeline
import speech_recognition as sr
from datetime import datetime, timedelta
@cceyda
cceyda / cli.js
Created September 14, 2022 10:21 — forked from mattdesl/cli.js
colour palette from text prompt using Stable Diffusion https://twitter.com/mattdesl/status/1569457645182152705
/**
* General-purpose NodeJS CLI/API wrapping the Stable-Diffusion python scripts.
*
* Note that this uses an older fork of stable-diffusion
* with the 'txt2img.py' script, and that script was modified to
* support the --outfile command.
*/
var { spawn, exec } = require("child_process");
var path = require("path");
# Categorizer, by Peter Baylies (@pbaylies)
# Unsupervised categorization of generated or real images using deep features, dimensionality reduction, and clustering
import click
from tqdm import tqdm
import math
import numpy as np
import torch
import pickle
import PIL.Image
import os.path
@cceyda
cceyda / fork_bookmarklet.js
Created July 14, 2022 09:03
Bookmarklet for finding forks that are ahead
javascript:(async () => {
/* while on the forks page, collect all the hrefs and pop off the first one (original repo) */
const aTags = [...document.querySelectorAll('div.repo a:last-of-type')].slice(1);
for (const aTag of aTags) {
/* fetch the forked repo as html, search for the "This branch is [n commits ahead,] [m commits behind]", print it directly onto the web page */
await fetch(aTag.href)
.then(x => x.text())
.then(html => aTag.outerHTML += `${html.match(/This branch is.*/).pop().replace('This branch is', '').replace(/([0-9]+ commits? ahead)/, '<font color="#0c0">$1</font>').replace(/([0-9]+ commits? behind)/, '<font color="red">$1</font>')}`)
.catch(console.error);
@cceyda
cceyda / GoAccessCaddyLogsReport.sh
Created May 18, 2021 09:41 — forked from baakeydow/GoAccessCaddyLogsReport.sh
Inspect Caddy logs with GoAccess
#!/usr/bin/env bash
sudo goaccess /var/log/caddy/logs/access.log \
--html-pref='{"theme":"darkBlue","perPage":50,"layout":"vertical","showTables":true,"visitors":{"plot":{"chartType":"area-spline"}}}' \
-o /full/path/to/new/report.html \
--with-mouse \
--hl-header \
--with-output-resolver \
--ignore-crawlers \
--all-static-files \
@cceyda
cceyda / split_by_silence.sh
Created March 26, 2021 18:44 — forked from vi/split_by_silence.sh
Using FFmpeg to split multimedia file into parts based on audio volume level
#!/bin/bash
IN=$1
OUT=$2
true ${SD_PARAMS:="-55dB:d=0.3"};
true ${MIN_FRAGMENT_DURATION:="20"};
export MIN_FRAGMENT_DURATION
if [ -z "$OUT" ]; then
from graphviz import Digraph
import torch
from torch.autograd import Variable, Function
def iter_graph(root, callback):
queue = [root]
seen = set()
while queue:
fn = queue.pop()
if fn in seen:
@cceyda
cceyda / gist:cfd64b36f39fe59d58e6c43227f2ee7b
Last active February 26, 2021 09:02 — forked from soumith/gist:01da3874bf014d8a8c53406c2b95d56b
Install PillowSIMD+libjpeg-turbo on Conda
pip3 install fastai==1.0.61
pip3 uninstall --force pillow -y
# install libjpeg-turbo to $HOME/turbojpeg
git clone https://github.com/libjpeg-turbo/libjpeg-turbo
pushd libjpeg-turbo
mkdir build
cd build
cmake .. -DCMAKE_INSTALL_PREFIX:PATH=$HOME/turbojpeg
make
@cceyda
cceyda / getdocstrings.py
Created January 15, 2021 09:16 — forked from SpotlightKid/getdocstrings.py
Parse Python source code and get or print docstrings.
# -*- coding: utf-8 -*-
"""Parse Python source code and get or print docstrings."""
__all__ = ('get_docstrings', 'print_docstrings')
import ast
from itertools import groupby
from os.path import basename, splitext
@cceyda
cceyda / streamlit_prodigy.py
Created July 2, 2020 13:09 — forked from ines/streamlit_prodigy.py
Streamlit + Prodigy
"""
Example of a Streamlit app for an interactive Prodigy dataset viewer that also lets you
run simple training experiments for NER and text classification.
Requires the Prodigy annotation tool to be installed: https://prodi.gy
See here for details on Streamlit: https://streamlit.io.
"""
import streamlit as st
from prodigy.components.db import connect
from prodigy.models.ner import EntityRecognizer, merge_spans, guess_batch_size