Skip to content

Instantly share code, notes, and snippets.

View chaitanyagupta's full-sized avatar

Chaitanya Gupta chaitanyagupta

View GitHub Profile
@chaitanyagupta
chaitanyagupta / ffmpeg.md
Created July 16, 2021 11:21 — forked from protrolium/ffmpeg.md
ffmpeg guide

ffmpeg

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

You can get the list of installed codecs with:

@chaitanyagupta
chaitanyagupta / json-parser.lisp
Created April 2, 2018 12:57 — forked from tanakahx/json-parser.lisp
JSON parser implemented with cl-lex and CL-Yacc
#|
JSON parser implemented with cl-lex and CL-Yacc
USAGE:
JSON-PARSER> (parse-with-lexer (json-lexer
"{\"foo\":\"bar\",\"baz\":\"bang\",\"bing\":100,\"bingo\":1.1,\"bazo\": [1,2,\"foo\"]}")
json-parser)
(:OBJ ("foo" . "bar") ("baz" . "bang") ("bing" . 100) ("bingo" . 1.1) ("bazo" 1 2 "foo"))
JSON-PARSER> (with-open-file (*standard-input* "test.json")
@chaitanyagupta
chaitanyagupta / install-gm-w-librvg.sh
Created August 18, 2016 15:08 — forked from whyvez/install-gm-w-librvg.sh
Installs ImageMagick --with-librsvg on Amazon Linux
export PKG_CONFIG_PATH=/usr/lib64/pkgconfig:/usr/lib/pkgconfig
export PATH=/usr/bin:$PATH
export LDFLAGS=-L/usr/lib64:/usr/lib
export LD_LIBRARY_PATH=/usr/lib64:/usr/lib
export CPPFLAGS=-I/usr/include
sudo yum-config-manager --enable epel
#sudo yum update -y
sudo yum install -y gcc gcc-c++ glib2-devel.x86_64 libxml2-devel.x86_64 libpng-devel.x86_64 \
libjpeg-turbo-devel.x86_64 gobject-introspection.x86_64 gobject-introspection-devel.x86_64
@chaitanyagupta
chaitanyagupta / AMPNavigationBar.m
Last active December 25, 2015 18:59 — forked from aprato/AMPNavigationBar.m
Use CGRectGetHeight() instead of accessing height directly.
// .h
@interface AMPNavigationBar : UINavigationBar
@property (nonatomic, assign) CGFloat extraColorLayerOpacity UI_APPEARANCE_SELECTOR;
@end
// .m
;;; Usage (percentage (analyze-systems '(a b c d))) => 42.23
(eval-when (:compile-toplevel :load-toplevel :execute)
(when (asdf:find-system :named-readtables nil)
(asdf:load-system :named-readtables)))
(defun analyze-form (form)
(typecase form
(symbol
(when (eql (symbol-package form) (find-package 'cl))