Skip to content

Instantly share code, notes, and snippets.

Focusing on software engineering 😏

Tao He sighingnow

Focusing on software engineering 😏
Block or report user

Report or block sighingnow

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
sighingnow /
Created Jun 30, 2019 — forked from protrolium/
using ffmpeg to extract audio from video files


Converting Audio into Different Formats / Sample Rates

Minimal example: transcode from MP3 to WMA:
ffmpeg -i input.mp3 output.wma

You can get the list of supported formats with:
ffmpeg -formats

Convert WAV to MP3, mix down to mono (use 1 audio channel), set bit rate to 64 kbps and sample rate to 22050 Hz:

sighingnow / Docset for LLVM and
Last active Mar 27, 2019
Build docset for LLVM/Clang
View Docset for LLVM and

Build LLVM/Clang Docset

  1. Modify LLVM/Clang

      • LLVM: @abs_top_builddir@/doxygen/llvm(clang).tag

Tricks in Modern C++


Whether the type is a specialization of template T.

template <template <typename...> class T, typename U>
sighingnow / bench-enum.hs
Created May 3, 2018
Benchmark on several implementations of `numericEnumFromThen` and `numericEnumFromThenTo`.
View bench-enum.hs
{-# LANGUAGE BangPatterns #-}
import Criterion.Main
import Weigh
numericEnumFromThen :: (Fractional a) => a -> a -> [a]
numericEnumFromThen n m = n `seq` m `seq` (n : numericEnumFromThen m (m+m-n))
numericEnumFromThenTo :: (Ord a, Fractional a) => a -> a -> a -> [a]
numericEnumFromThenTo e1 e2 e3
sighingnow / error-message
Created Apr 26, 2018
ghc treat certain kinds of warnings as errors when compile c source file.
View error-message
D:\Open>gcc test.c -Wall -c
test.c: In function 'g':
test.c:8:14: warning: passing argument 1 of 'f' from incompatible pointer type [-Wincompatible-pointer-types]
return f(cp);
test.c:1:5: note: expected 'int *' but argument is of type 'char *'
int f(int *a) {
D:\Open>stack exec -- ghc -c test.c -Wall
sighingnow /
Last active Dec 31, 2017 — forked from gyglim/
Logging to tensorboard with manually generated summaries (not relying on summary ops)
"""Simple example on how to log scalars and images to tensorboard without tensor ops.
License: Copyleft
__author__ = "Michael Gygli, Tao He"
import tensorflow as tf
from StringIO import StringIO
sighingnow / misc.hs
Created Jan 2, 2017
concatMap and filter using Foldable and Traversable.
View misc.hs
concatMap :: (Foldable f, Monoid (f b)) => (a -> f b) -> f a -> f b
concatMap = foldMap
filter :: (Applicative f, Foldable f, Monoid (f a)) =>
(a -> Bool) -> f a -> f a
filter p = foldMap (\a -> if p a then pure a else mempty)
sighingnow / Makefile
Last active Dec 27, 2016
Expose C++ API to Haskell via FFI.
View Makefile
all: libacpp.dll app.exe
GHC := stack ghc --
%.o: %.cpp
$(CXX) -c $< -o $@
libacpp.dll: acpp.o acpp_capi.o
$(CXX) $^ -shared -o $@ # On Linux/Unix, -fPIC is needed.
sighingnow / T.hs
Created Dec 27, 2016
Haskell's $ operator for types.
View T.hs
{-# LANGUAGE TypeOperators #-}
module T where
-- | Infix application.
-- @
-- f :: IO $ Maybe Int
-- =
sighingnow / stack-config.yaml
Created Dec 26, 2016
Personal stack global configuration.
View stack-config.yaml
# This file contains default non-project-specific settings for 'stack', used
# in all projects. For more information about stack's configuration, see
# {}
- require-hashes: false
gpg-verify: false
name: TUNA
You can’t perform that action at this time.