Skip to content

Instantly share code, notes, and snippets.

@jacekkarczmarczyk
jacekkarczmarczyk / VerticalTabs.vue
Created August 5, 2018 09:56
Vuetify vertical tabs
<template>
<div :style="containerStyle" class="vertical-tabs" :class="{'vertical-tabs--vertical-text': verticalText, 'vertical-tabs--horizontal-text': !verticalText}">
<v-tabs :value="value" @input="$emit('input', $event)" :show-arrows="verticalText" :color="color" :slider-color="sliderColor" :style="tabsStyle">
<v-tab v-for="item in items" :key="item">{{ item }}</v-tab>
</v-tabs>
</div>
</template>
<script>
export default {
@kboek
kboek / mic_to_watson_stt.cs
Created July 30, 2017 12:57
Record from Microphone with NAudio and send to IBM Watson Speech-To-Text
using NAudio.Wave;
using System;
using System.Net.WebSockets;
namespace Raskenlund
{
class Recorder
{
private WaveInEvent waveIn;
@nfriedly
nfriedly / WatsonSTTWebsocketExample.cs
Last active January 29, 2021 20:07
C# example of streaming Watson Speech to Text results over a WebSocket
// Note: The official .net SDK is in progress. It doesn't support streaming Speech to Text at the time of writing,
// but it will soon. Please check it out before using this code.
//
// https://github.com/watson-developer-cloud/dotnet-standard-sdk
using System;
using System.Net.WebSockets;
using System.Net;
using System.Runtime.Serialization.Json;
using System.Threading;
public static class SftpExtensions
{
/// <remarks>
/// unfortunately the ssh library doesn't expose a modern async api
/// that supports cancellation via CancellationToken
/// so we have to wrap the APM pattern with a TaskCompletionSource
/// </remarks>
public static Task UploadFileAsync(this SftpClient sftpClient, Stream input, string path, bool canOverride, Action<ulong> uploadCallback = null, CancellationToken cancellationToken = default(CancellationToken))
{
var tcs = new TaskCompletionSource<SftpUploadAsyncResult>();
@webdevwilson
webdevwilson / State.java
Created March 29, 2013 16:38
Enum containing states with abbreviations
import java.util.HashMap;
import java.util.Map;
public enum State {
ALABAMA("Alabama", "AL"), ALASKA("Alaska", "AK"), AMERICAN_SAMOA("American Samoa", "AS"), ARIZONA("Arizona", "AZ"), ARKANSAS(
"Arkansas", "AR"), CALIFORNIA("California", "CA"), COLORADO("Colorado", "CO"), CONNECTICUT("Connecticut", "CT"), DELAWARE(
"Delaware", "DE"), DISTRICT_OF_COLUMBIA("District of Columbia", "DC"), FEDERATED_STATES_OF_MICRONESIA(
"Federated States of Micronesia", "FM"), FLORIDA("Florida", "FL"), GEORGIA("Georgia", "GA"), GUAM("Guam", "GU"), HAWAII(
"Hawaii", "HI"), IDAHO("Idaho", "ID"), ILLINOIS("Illinois", "IL"), INDIANA("Indiana", "IN"), IOWA("Iowa", "IA"), KANSAS(