This is a quick tutorial on how to create VS Code snippets that formats your snippet placeholder variables correctly.
Hopefully Google will show this in the search results so that others that are struggling in this area can be helped.
<Project Sdk="Microsoft.NET.Sdk"> | |
<PropertyGroup> | |
<OutputType>Exe</OutputType> | |
<TargetFramework>netcoreapp3.1</TargetFramework> | |
<AllowUnsafeBlocks>true</AllowUnsafeBlocks> | |
</PropertyGroup> | |
<ItemGroup> | |
<PackageReference Include="NAudio" Version="1.10.0" /> |
// Code ported from https://0fps.net/2012/06/30/meshing-in-a-minecraft-game/ | |
// Note this implementation does not support different block types or block normals | |
// The original author describes how to do this here: https://0fps.net/2012/07/07/meshing-minecraft-part-2/ | |
const int CHUNK_SIZE = 32; | |
// These variables store the location of the chunk in the world, e.g. (0,0,0), (32,0,0), (64,0,0) |
This gist will show how to setup Raspbian Stretch as a headless Bluetooth A2DP audio sink. This will allow your phone, laptop or other Bluetooth device to play audio wirelessly through a Rasperry Pi.
A quick search will turn up a plethora of tutorials on setting up A2DP on the Raspberry Pi. However, I felt this gist was necessary because this solution is:
/* | |
needs libmosquitto-dev | |
$ gcc -o libmosq libmosq.c -lmosquitto | |
*/ | |
#include <stdio.h> | |
#include <mosquitto.h> | |
#include <stdlib.h> | |
#include <string.h> | |
#include <unistd.h> |
cmake_minimum_required(VERSION 3.2) | |
project(YourProject) | |
add_subdirectory(src) | |
add_subdirectory(lib) |
# I had a LOT of trouble finding working examples of the ZAutomation API for RaZberry API. I eventually figured out what exactly to use by combining information from multiple sources and sniffing requests from the 'Expert UI'. Some areas I found information: | |
- http://docs.zwayhomeautomation.apiary.io/ | |
- http://wiki.micasaverde.com/index.php/ZWave_Command_Classes | |
- https://www.npmjs.org/package/mqtt-zway | |
- The included PDFs | |
- The expert API area on the device web UI | |
- https://chrome.google.com/webstore/detail/postman-interceptor/aicmkgpgakddgnaphhhpliifpcfhicfo?hl=en (Postman POST/GET sniffer) | |
# Some general RaZberry API commands: |
LD SP,$fffe ; $0000 Setup Stack | |
XOR A ; $0003 Zero the memory from $8000-$9FFF (VRAM) | |
LD HL,$9fff ; $0004 | |
Addr_0007: | |
LD (HL-),A ; $0007 | |
BIT 7,H ; $0008 | |
JR NZ, Addr_0007 ; $000a | |
LD HL,$ff26 ; $000c Setup Audio |
// -------------------------------------------------------------------------------------------------------------------- | |
// <copyright file="AutoAttachVs.cs" company="QutEcoacoustics"> | |
// All code in this file and all associated files are the copyright and property of the QUT Ecoacoustics Research Group (formerly MQUTeR, and formerly QUT Bioacoustics Research Group). | |
// </copyright> | |
// <summary> | |
// Example taken from this gist. | |
// </summary> | |
// -------------------------------------------------------------------------------------------------------------------- | |
#if DEBUG |