Skip to content

Instantly share code, notes, and snippets.

View alexey-detr's full-sized avatar
🦉

Alexey Ponomarev alexey-detr

🦉
View GitHub Profile
@alexey-detr
alexey-detr / main.cpp
Last active April 7, 2024 04:56
Читаем заголовок WAV файла на C++
#include <stdio.h>
#include <tchar.h>
#include <conio.h>
#include <math.h>
// Структура, описывающая заголовок WAV файла.
struct WAVHEADER
{
// WAV-формат начинается с RIFF-заголовка:
@alexey-detr
alexey-detr / main.cs
Last active September 29, 2015 20:38
Читаем заголовок WAV файла на C#
using System;
using System.IO;
using System.Runtime.InteropServices;
namespace WavFormatCSharp
{
[StructLayout(LayoutKind.Sequential)]
// Структура, описывающая заголовок WAV файла.
internal class WavHeader
{
@alexey-detr
alexey-detr / gist:1664495
Created January 23, 2012 17:49
Ошибка при сборке
error D8045: cannot compile C file '..\codec\ag_dec.c' with the /clr option
@alexey-detr
alexey-detr / gist:1664676
Created January 23, 2012 18:28
alacConvert результаты работы
F:\vanac>alacConvert.exe a.wav a.caf
Input file: a.wav
Output file: a.caf
F:\vanac>alacConvert.exe a.caf b.wav
Input file: a.caf
Output file: b.wav
@alexey-detr
alexey-detr / gist:3582191
Created September 1, 2012 18:14
Creating new DB and user for it in MySQL
CREATE DATABASE amarokdb CHARACTER SET utf8 COLLATE utf8_unicode_ci;
GRANT USAGE ON *.* TO amarokuser@localhost IDENTIFIED BY 'amarokpasswd';
GRANT ALL PRIVILEGES ON amarokdb.* TO amarokuser@localhost;
FLUSH PRIVILEGES;
@alexey-detr
alexey-detr / xdebug.ini
Last active December 21, 2015 06:18
My Xdebug configuration. It's pretty handy.
zend_extension=/usr/lib/php5/20100525/xdebug.so
xdebug.profiler_enable_trigger=1
xdebug.remote_enable=1
xdebug.remote_port=9900
xdebug.profiler_output_name=cachegrind.out.%u
@alexey-detr
alexey-detr / install_headers.sh
Last active December 22, 2015 22:09
If installing VirtualBox Guest Additions for Ubuntu fails.
sudo apt-get install build-essential linux-headers-`uname -r` dkms
chsh -s $(which zsh)
id -u `ps xu | grep -E "([a]pache2|nginx)" | awk '{print $1}' | head -n1`
@alexey-detr
alexey-detr / beanstalk-php-worker.sh
Last active December 23, 2015 12:09
Wrapper for PHP scripts to deamonize em. It is allowed to specify user for further passing it to PHP script e.g. app/beanstalk-php-worker.sh start www-data
#!/bin/sh
### BEGIN INIT INFO
# Required-Start: beanstalk-job-server
# Default-Start: 2 3 4 5
# Default-Stop:
# Description: Php workers wrapper
### END INIT INFO
WORKDIR="$( cd "$( dirname "$0" )" && pwd )"