Skip to content

Instantly share code, notes, and snippets.

View codesoda's full-sized avatar

Chris Raethke codesoda

View GitHub Profile
@codesoda
codesoda / webhook-circleback.py
Created May 15, 2024 10:30 — forked from hamelsmu/webhook-circleback.py
Generate a project proposal automatically from a meeting transcript
from fastapi import Request, HTTPException
from pydantic import BaseModel, BaseModel, HttpUrl
from modal import Secret, App, web_endpoint, Image
from typing import Optional, List
from example import proposal
import os
app = App(name="circleback", image=Image.debian_slim().pip_install("openai", "pydantic", "fastapi"))
class Attendee(BaseModel):
@codesoda
codesoda / select_other.html
Created September 28, 2012 10:44
show/hide text box based on selected drop down
<!--
the select needs
- "has_other" css class
- "data-other" attribute, which points to the id of the element to hide/show (normally a textbox)
- "data-other-text" attribute, which indicates the text which indicates that other has been selected
-->
<select class="has_other" data-other="#textbox_id" data-other-text="...other">
<option>option 1</option>
<option>...other</option>
@codesoda
codesoda / ffmpeg.md
Created August 24, 2022 00:52 — forked from protrolium/ffmpeg.md
ffmpeg guide

ffmpeg

Converting Audio into Different Formats / Sample Rates

Minimal example: transcode from MP3 to WMA:
ffmpeg -i input.mp3 output.wma

You can get the list of supported formats with:
ffmpeg -formats

You can get the list of installed codecs with:

@codesoda
codesoda / HttpProxy.go
Created March 14, 2022 10:01 — forked from yowu/HttpProxy.go
A simple HTTP proxy by Golang
package main
import (
"flag"
"io"
"log"
"net"
"net/http"
"strings"
)
const padLeft = (number, n,str) => {
return number.toString().length >= n ? number : Array(n-String(number).length + 1).join(str||'0') + number;
}
const playTime = (milliseconds) => {
let seconds = milliseconds / 1000.0,
hours = Math.floor(seconds / 3600),
minutes = Math.floor((seconds % 3600) / 60),
only_seconds = Math.round(seconds % 60),
parts = [];
@codesoda
codesoda / Gemfile
Created January 11, 2018 11:18 — forked from chezou/Gemfile
Example code of ruby with Amazon Polly
source 'https://rubygems.org'
gem 'nokogiri', '~>1.6'
gem 'aws-sdk', '~> 2'
@codesoda
codesoda / API.md
Created September 4, 2017 05:03 — forked from iros/API.md
Documenting your REST API

Title

<Additional information about your API call. Try to use verbs that match both request type (fetching vs modifying) and plurality (one vs multiple).>

  • URL

    <The URL Structure (path only, no root url)>

  • Method:

@codesoda
codesoda / Requirements.md
Last active August 16, 2017 17:06
Tagging API

Generic Tagging JSON API

We will be building a Generic Tagging JSON API that can store, retrieve, delete and report on the usage of a "tag" across different entities. This is a guide for the endpoints, if you think you have a better route or would like to modify the naming/schema feel free. We like specs, so we hope you do to.

Create an Entry

POST /tag

- Entity Type, e.g. 'Product', 'Article'
@codesoda
codesoda / JsonBuilder.cs
Last active July 31, 2017 12:29
A Simple c# class for creating well formed JSON strings when serializing classes with Json.NET is overkill.
public class JsonBuilder
{
private readonly StringBuilder _sb;
private readonly Stack<bool> _hasPreviousProperties;
private bool RequiresComma { get { return _hasPreviousProperties.Count > 0 && _hasPreviousProperties.Peek(); } }
public JsonBuilder() {
_sb = new StringBuilder();
@codesoda
codesoda / check.sh
Created September 9, 2016 07:14
Check apple store to see if iphone is available yet
main() {
while [[ true ]]; do
local request="$(curl -s 'http://www.apple.com/us/shop/goto/iphone_7/select' | grep 'be back soon')"
if [[ ! $request ]]; then
say 'Yep, time to buy'
break
fi