This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
#include <tchar.h> | |
#include <conio.h> | |
#include <math.h> | |
// Структура, описывающая заголовок WAV файла. | |
struct WAVHEADER | |
{ | |
// WAV-формат начинается с RIFF-заголовка: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const inputStream = process.stdin; | |
function readHeader(stream) { | |
let buffer = stream.read(44); | |
const chunkId = buffer.slice(0, 4).toString(); | |
const chunkSize = buffer.readUInt32LE(4); | |
const format = buffer.slice(8, 12).toString(); | |
const subchunk1Id = buffer.slice(12, 16).toString(); | |
const subchunk1Size = buffer.readUInt32LE(16); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
BRANCH=`git branch | grep '^\*' | cut -b3-` | |
REFS=`echo "$BRANCH" | sed -E 's/^[^_]+_([0-9]+)_.+$/\1/'` | |
echo "Refs #$BRANCH - " > $1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const axios = require('axios'); | |
const cheerio = require('cheerio'); | |
const childProcess = require('child_process'); | |
(async () => { | |
const {data: npmListHtml} = await axios.get('https://www.npmjs.com/browse/depended/lodash'); | |
const $ = cheerio.load(npmListHtml); | |
const npmPackageLinks = $('section a').map((i, elem) => $(elem).attr('href')).get(); | |
childProcess.execSync(`rm -rf ${__dirname}/packages`); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# You have to install mime package | |
# npm install -g mime | |
function base64urldata | |
set filename $argv[1] | |
echo "data:"(mime $filename)";base64,"(cat $filename | openssl enc -base64 | tr -d '\n') | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## Defaults for the beanstalkd init script, /etc/init.d/beanstalkd on | |
## Debian systems. Append ``-b /var/lib/beanstalkd'' for persistent | |
## storage. | |
BEANSTALKD_LISTEN_ADDR=127.0.0.1 | |
BEANSTALKD_LISTEN_PORT=11300 | |
DAEMON_OPTS="-l $BEANSTALKD_LISTEN_ADDR -p $BEANSTALKD_LISTEN_PORT -b /var/lib/beanstalkd" | |
## Uncomment to enable startup during boot. | |
START=yes |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 )" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
id -u `ps xu | grep -E "([a]pache2|nginx)" | awk '{print $1}' | head -n1` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
chsh -s $(which zsh) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo apt-get install build-essential linux-headers-`uname -r` dkms |
NewerOlder