Skip to content

Instantly share code, notes, and snippets.

View maZahaca's full-sized avatar
🥑
Distributed CTO

Andrew Red maZahaca

🥑
Distributed CTO
View GitHub Profile
@maZahaca
maZahaca / audio-to-text-to-sentiment.js
Created February 3, 2024 11:34
Code block showing how with JavaScript and HuggingFace API, you can easily convert audio feedback from the customer to text and then understand its sentiment.
const {
HUGGINGFACE_API_KEY,
} = process.env;
async function fetchHuggingFaceModel(model, data) {
const response = await fetch(
`https://api-inference.huggingface.co/models/${model}`,
{
headers: { Authorization: `Bearer ${HUGGINGFACE_API_KEY}` },
method: 'POST',
@maZahaca
maZahaca / README.md
Last active September 19, 2017 12:26
Just an example of LUA block in NGINX conf for preventing unnecessary traffic
server {
     location / {
        client_max_body_size 100k;
        client_body_buffer_size 100k;

        access_by_lua_block {
            -- check the client IP address is in our black list
            if ngx.var.remote_addr == "132.5.72.3" then
 ngx.exit(ngx.HTTP_FORBIDDEN)
@maZahaca
maZahaca / README.md
Last active November 19, 2021 22:19
Rancher VPN

Rancher VPN (with httpbasic) in a few steps

docker-compose.yml

openvpn-httpbasic-server:
  image: mdns/rancher-openvpn:1.2
  privileged: true
  volumes:
    - /var/lib/openvpn/data:/etc/openvpn
  volumes_from:
@maZahaca
maZahaca / designer.html
Last active August 29, 2015 14:07
designer
<link rel="import" href="../paper-tabs/paper-tabs.html">
<link rel="import" href="../paper-tabs/paper-tab.html">
<polymer-element name="my-element">
<template>
<style>
:host {
position: absolute;
width: 100%;