Skip to content

Instantly share code, notes, and snippets.

View alogic0's full-sized avatar

Oleg Tsybulskyi alogic0

  • Odessa, Ukraine
View GitHub Profile
@RhetTbull
RhetTbull / copy_file_with_progress_bar.py
Last active February 20, 2024 07:53
Python method to copy a file with a callback (e.g. to show a progress bar). Includes example of copying with both click.progressbar and tqdm.
""" Copy a file with callback (E.g. update a progress bar) """
# based on flutefreak7's answer at StackOverflow
# https://stackoverflow.com/questions/29967487/get-progress-back-from-shutil-file-copy-thread/48450305#48450305
# License: MIT License
import os
import pathlib
import shutil
@oleksabor
oleksabor / ffcut.sh
Last active May 16, 2020 21:25
bash script to cut mp3 silence at the start and at the end. ffmpeg silencedetect is used
#!/bin/bash
if [ "$1" == "" ]; then
echo "no input file name";
exit 1;
else
mp3file="$1";
fi
@snoyberg
snoyberg / README.md
Last active August 27, 2018 05:57
Miniature Haskell interactive environment for my kids to play around with
@tfausak
tfausak / count-hackage-revisions.hs
Last active June 23, 2017 17:32
Counts revisions of packages on Hackage.
#!/usr/bin/env stack
-- stack --resolver lts-8.19 script --package Cabal --package Glob
-- This script counts the total number of versions and revisions on Hackage.
--
-- Usage:
-- 1. Download and unpack <https://hackage.haskell.org/01-index.tar.gz>.
-- 2. Run `./Main.hs 'path-to-unpacked-index/**/*.cabal'`.
--
-- Example output as of 23 July 2017:
@jamesthompson
jamesthompson / install-stack-raspbian.sh
Created February 1, 2017 16:46
A script to install stack on Raspbian
#!/bin/sh
set +ex
# A script to install stack on Raspbian
# Use stack installer script to install stack
curl -sSL https://get.haskellstack.org/ | sh
# Use apt-get to install llvm
@tfausak
tfausak / Dependencies.hs
Last active January 7, 2017 23:35
Parses a Hackage package index and outputs a JSON description of dependencies. { package: { version: { dependency: bounds } } }
{-
stack
--resolver lts-7
--install-ghc
runghc
--package aeson
--package bytestring
--package containers
--
-Wall
@tfausak
tfausak / haskell-package-versions.hs
Last active December 24, 2016 04:02
Gets the package index from Hackage and outputs a bunch of information about their version numbers.
{- stack
--resolver lts-7
--install-ghc
runghc
--package containers
--package filepath
--package http-client
--package http-client-tls
--package tar
--package time
@shreve
shreve / pdfmarks
Last active August 5, 2023 06:44
Example of adding PDF metadata (bookmarks / ToC) with Ghostscript
[ /Title (Elementary Differential Equations)
/Author (Edwards & Penney)
/DOCINFO pdfmark
[ /Title (Contents)
/Page 6
/OUT pdfmark
[ /Count -8
/Title (1. First-Order Differential Equations)