Skip to content

Instantly share code, notes, and snippets.

View pnutmath's full-sized avatar
🌏
Focusing

Abhay pnutmath

🌏
Focusing
View GitHub Profile
@BizarroDavid
BizarroDavid / send-sms.go
Last active November 10, 2022 05:14
Sending an SMS Text Message using AWS SNS service in GoLang
//assumes you have the following environment variables setup for AWS session creation
// AWS_SDK_LOAD_CONFIG=1
// AWS_ACCESS_KEY_ID=XXXXXXXXXX
// AWS_SECRET_ACCESS_KEY=XXXXXXXX
// AWS_REGION=us-west-2( or AWS_DEFAULT_REGION=us-east-1 if you are having trouble)
package main
import (
"fmt"
@mrbar42
mrbar42 / README.md
Last active July 6, 2024 23:08
bash scripts to create VOD HLS stream with ffmpeg almighty (tested on Linux and OS X)

running:

bash create-vod-hls.sh beach.mkv

will produce:

    beach/
      |- playlist.m3u8
 |- 360p.m3u8
@pnutmath
pnutmath / angular-add-to-home-screen.component.ts
Last active March 12, 2021 20:15
Angular - Add to home screen POC (app.component.ts)
import { Component, HostListener } from '@angular/core';
@Component({
selector: 'app-root',
template: '<button (click)="addToHomeScreen()" *ngIf="showButton">Add to Home Scree</button>',
styleUrls: ['./app.component.scss']
})
export class AppComponent {
deferredPrompt: any;
@pnutmath
pnutmath / scrape-and-post-to-discourse.js
Last active July 27, 2023 10:18
Scrape documentation and post to QnAs discourse
import fetch from 'node-fetch';
import cheerio from 'cheerio';
import { Configuration, OpenAIApi } from 'openai';
const OPENAI_API_KEY = '<YOUR_OPENAI_API_KEY>';
const DISCOURSE_SERVER_URL = '<YOUR_DISCOURSE_SERVER_URL>';
const DISCOURSE_API_KEY = '<YOUR_DISCOURSE_API_KEY>';
const DISCOURSE_POST_CREATORS = ['<CREATOR1>', '<CREATOR2>'];
const DISCOURSE_PRODUCT_MODERATORS = ['<MODERATOR1>', '<MODERATOR2>'];
const CATEGORY_ID = 1;