Skip to content

Instantly share code, notes, and snippets.

View E3V3A's full-sized avatar

E:V:A E3V3A

View GitHub Profile
@E3V3A
E3V3A / protos.diff
Created April 12, 2018 14:05 — forked from phsultan/testApiKeyAndGrpc.js
Google Speech Recognition with API key + gRPC
--- node_modules/@google-cloud/speech/protos/google/cloud/speech/v1/cloud_speech.proto.orig 2018-04-12 11:44:01.000000000 +0200
+++ node_modules/@google-cloud/speech/protos/google/cloud/speech/v1/cloud_speech.proto 2018-04-12 11:44:51.000000000 +0200
@@ -35,7 +35,7 @@
// Performs synchronous speech recognition: receive results after all audio
// has been sent and processed.
rpc Recognize(RecognizeRequest) returns (RecognizeResponse) {
- option (google.api.http) = { post: "/v1/speech:recognize" body: "*" };
+ option (google.api.http) = { post: "/v1/speech:recognize" };
}
@E3V3A
E3V3A / testApiKeyAndGoogleAuthLibrary.js
Created April 12, 2018 14:05 — forked from phsultan/testApiKeyAndGoogleAuthLibrary.js
Google Speech Recognition with API key + google-auth-library
const fs = require('fs');
const { auth } = require('google-auth-library');
const API_KEY = 'ADD YOUR API KEY HERE';
const fileName = './audio.raw';
// Reads a local audio file and converts it to base64
const file = fs.readFileSync(fileName);
const audioBytes = file.toString('base64');
@E3V3A
E3V3A / mount-raspbian-image
Created May 11, 2018 20:05
Locally mounting a Raspberry Pi Raspbian Linux image
#!/bin/bash
#
# Usage: sudo ./mount-raspbian-image <imagename>
#
if [ -z "$1" ]
then
echo "Usage: sudo ./mount-raspbian-image <imagename>"
exit
fi
@E3V3A
E3V3A / matlab-octave.m
Created March 25, 2019 22:32 — forked from gramian/matlab-octave.m
Octave and Matlab Snippets
%% Math %%
si = @(x) sin(x) ./ x; % cardinal sine without pi multiplied argument
hsin = @(x) 0.5*(1.0 - cos(x)); % haversed sine
hcos = @(x) 0.5*(1.0 + cos(x)); % haversed cosine
sigm = @(x,k) 0.5*tanh(0.5*k*x) + 0.5; % sigmoid function to (exp(-kx)+1)^-1