Skip to content

Instantly share code, notes, and snippets.

View mxwell's full-sized avatar

Murat Khairulin mxwell

  • Almaty, Kazakhstan
View GitHub Profile
@mxwell
mxwell / tlv320aic23_spi.c
Created May 12, 2012 07:31 — forked from brandonhamilton/tlv320aic23_spi.c
ALSA SoC TLV320AIC23 codec driver (SPI version)
/*
* ALSA SoC TLV320AIC23 codec driver (SPI version)
*
* Author: Brandon Hamilton <brandon.hamilton@gmail.com>
*
* Based on sound/soc/codecs/tlv320aic23.c by Arun KS
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
@mxwell
mxwell / .emacs
Created July 27, 2012 12:34
Emacs configuration file
; dance in Linux Kernel style
(setq c-default-style "linux")
; get off scroll bar
(if (fboundp 'scroll-bar-mode) (scroll-bar-mode -1))
; get off tool bar
(if (fboundp 'tool-bar-mode) (tool-bar-mode -1))
; get off menu bar
(if (fboundp 'menu-bar-mode) (menu-bar-mode -1))
@mxwell
mxwell / .Xresourses
Created July 31, 2012 05:53
xterm config
XTerm*faceName: Bitstream Vera Serif Mono
XTerm*faceSize: 10
@mxwell
mxwell / .vimrc
Last active January 5, 2020 02:58
Vim config
set number
set relativenumber
set expandtab
set tabstop=4
set shiftwidth=4
syntax on
set laststatus=2
set hlsearch
" use https://github.com/junegunn/vim-plug for plugin management
@mxwell
mxwell / c.vim
Created December 9, 2012 19:17
Basic config for Linux Kernel C Style
set noexpandtab " use tabs, not spaces
set tabstop=8 " tabstops of 8
set shiftwidth=8 " indents of 8
set textwidth=78 " screen in 80 columns wide, wrap at 78
set autoindent smartindent " turn on auto/smart indenting
set smarttab " make <tab> and <backspace> smarter
set backspace=eol,start,indent " allow backspacing over indent, eol, & start
filetype plugin indent on
@mxwell
mxwell / rip-hardbase.sh
Created February 25, 2013 03:00
Rip Hardbase.fm MP3 stream with mplayer. After finish in current directory file will be stored. File named as time stamp + ".mp3". There will be 30 minutes of gorgeous hardstyle music.
#! /bin/sh
(sleep 30m && kill `pidof mplayer`)&
mplayer -dumpstream -dumpfile `date +'%Y-%h-%d_%H-%M.mp3'` http://listen.hardbase.fm/tunein-mp3-pls
@mxwell
mxwell / normalize-mp3s.rb
Created February 26, 2013 12:13
Ruby script to convert ID3 tags of *.mp3 files from current directory from Windows-1251 to Unicode. Required: * Ruby * mid3iconv
#! /usr/local/bin/ruby
Dir.foreach("./") do |filename|
if /^[^.]*\.mp3$/i =~ filename
cmd = "mid3iconv -e \"Windows-1251\" \"%s\"" % filename
puts "next cmd: " + cmd
break if not system(cmd)
end
end
@mxwell
mxwell / flac_to_mp3.rb
Created June 1, 2013 22:54
Ruby script to convert *.flac to *.mp3 with ffmpeg in Windows
output_dir = "output"
if File.exists? output_dir
id = 1
while File.exists?(output_dir + id.to_s) && id < 10
id += 1
end
if id >= 10
puts "error: can't figure out new output directory name"
exit 0
@mxwell
mxwell / cpp-ifndef.sublime-snippet
Created September 6, 2013 21:04
For Sublime Text. Slightly different from std snippet for #ifndef ... #define ... #endif
<snippet>
<content><![CDATA[
#ifndef $1
#define $1
$2
#endif /* $1 */
]]></content>
<tabTrigger>ifndef</tabTrigger>
@mxwell
mxwell / dtds
Created September 25, 2013 14:56
DTD is a part of EDID. Samples for some modes.
## non-std: 720x288p@50Hz
- clock: 13.5MHz
- horizontal: 720-4-136-4 or 720-724-860-864
- vertical: 288-4-16-4 or 288-292-308-312
- DTD: `46 05 D0 90 20 20 18 10 04 88 40 01 00 00 00 00 00 18`
## std: 720x576p@50Hz
- clock: 27MHz
- horizontal: 720-732-796-864