Skip to content

Instantly share code, notes, and snippets.

View voidabhi's full-sized avatar

Abhijeet Mohan voidabhi

View GitHub Profile
@voidabhi
voidabhi / ffmpeg.md
Created May 22, 2017 14:14 — forked from protrolium/ffmpeg.md
using ffmpeg to extract audio from video files

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

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

some tools for diagrams in software documentation

Diagrams For Documentation

Obvious Choices

ASCII

Keybase proof

I hereby claim:

  • I am voidabhi on github.
  • I am voidabhi (https://keybase.io/voidabhi) on keybase.
  • I have a public key ASD6YnhMOVqP8nqcsYjygYAPhRgkDmpTW66dmVENYHdKZQo

To claim this, I am signing this object:

@voidabhi
voidabhi / helpers.go
Created June 26, 2016 22:25
Golang helpers
// GetBytes accepts any object (interface{]}) and returns its json encoded byte array
func GetBytes(key interface{}) ([]byte) {
var buf bytes.Buffer
enc := json.NewEncoder(&buf)
err := enc.Encode(key)
if err != nil {
return []byte("")
}
return buf.Bytes()
@voidabhi
voidabhi / benchmark.py
Last active February 19, 2016 15:40
Benchmarking for python functions
import time
def print_numbers(n):
for i in xrange(n):
pass
class BM(object):
@voidabhi
voidabhi / stdio.py
Created February 19, 2016 07:04
Python utility for writing to standard output
# coding=UTF-8
"""
@example
from stdio import stdio
stdio.write('hello world')
data = stdio.read()
print stdio.STDIN_FILENO
print stdio.STDOUT_FILENO
"""
import thread
@voidabhi
voidabhi / checkconfig.sh
Created February 18, 2016 12:04
Basic checkconfig commands
#!/bin/bash
# list all services
chkconfig --list
# check status of specific service
chkconfig --list | grep httpd
# start perticular service on run levels
chkconfig --level 35 httpd on
@voidabhi
voidabhi / ConsoleLogger.php
Last active February 16, 2016 08:00
Php Logging
<?php
namespace Logging;
use Psr\Log\AbstractLogger;
/**
* Class ConsoleLogger
*
* @package Thruway