Skip to content

Instantly share code, notes, and snippets.

View xVir's full-sized avatar

Danil Skachkov xVir

  • Google
  • Santa Clara
View GitHub Profile
@xVir
xVir / sublime.textile
Last active December 15, 2015 11:19
Sublime Text 2 – Useful Shortcuts

Sublime Text 2 – Useful Shortcuts (PC)

Loosely ordered with the commands I use most towards the top. Sublime also offer full documentation.

Editing

Ctrl+C copy current line (if no selection)
Ctrl+X cut current line (if no selection)
Ctrl+⇧+K delete line
Ctrl+↩ insert line after
@xVir
xVir / GoogleImporter
Last active December 10, 2015 02:38
RgeothesRecordsParsing
List<Record> result = new ArrayList<Record>();
for (int i = 0; i < nodes.getLength(); i++) {
Node node = nodes.item(i);
if (node.getNodeType() == Node.ELEMENT_NODE) {
Element element = (Element) node;
Record record = new Record();
@xVir
xVir / WaveHeaderWriter.cs
Created December 14, 2012 09:49
WAV file header writer
public class WaveHeaderWriter
{
static byte[] RIFF_HEADER = new byte[] { 0x52, 0x49, 0x46, 0x46 };
static byte[] FORMAT_WAVE = new byte[] { 0x57, 0x41, 0x56, 0x45 };
static byte[] FORMAT_TAG = new byte[] { 0x66, 0x6d, 0x74, 0x20 };
static byte[] AUDIO_FORMAT = new byte[] { 0x01, 0x00 };
static byte[] SUBCHUNK_ID = new byte[] { 0x64, 0x61, 0x74, 0x61 };
private const int BYTES_PER_SAMPLE = 2;
public static void WriteHeader(