Skip to content

Instantly share code, notes, and snippets.

@amitkot
amitkot / README.md
Created December 26, 2024 11:23 — forked from disler/README.md
Four Level Framework for Prompt Engineering
@amitkot
amitkot / openai_query.py
Last active November 21, 2023 11:05
Query OpenAI
from openai import OpenAI
client = OpenAI(api_key="API_KEY_HERE")
def query_gpt(prompt):
"""
This function queries OpenAI's GPT model for a response to a given prompt.
Parameters:
@amitkot
amitkot / voices.txt
Created January 15, 2023 12:21 — forked from mculp/voices.txt
List of voices available by the `say` command on OS X
Agnes en_US # Isn't it nice to have a computer that will talk to you?
Albert en_US # I have a frog in my throat. No, I mean a real frog!
Alex en_US # Most people recognize me by my voice.
Alice it_IT # Salve, mi chiamo Alice e sono una voce italiana.
Alva sv_SE # Hej, jag heter Alva. Jag är en svensk röst.
Amelie fr_CA # Bonjour, je m’appelle Amelie. Je suis une voix canadienne.
Anna de_DE # Hallo, ich heiße Anna und ich bin eine deutsche Stimme.
Bad News en_US # The light you see at the end of the tunnel is the headlamp of a fast approaching train.
Bahh en_US # Do not pull the wool over my eyes.
Bells en_US # Time flies when you are having fun.
@amitkot
amitkot / README.md
Created May 1, 2022 12:20 — forked from magnetikonline/README.md
List all Git repository objects by size.

List all Git repository objects by size

Summary

Bash script to:

  • Iterate all commits made within a Git repository.
@amitkot
amitkot / settings.json
Created March 20, 2022 20:54 — forked from gaetschwartz/settings.json
Nest files in Flutter projects on VSCode, inspired from https://github.com/antfu/vscode-file-nesting-config
"explorer.experimental.fileNesting.enabled": true,
"explorer.experimental.fileNesting.expand": false,
"explorer.experimental.fileNesting.patterns": {
"pubspec.yaml": ".flutter-plugins, .packages, .dart_tool, .flutter-plugins-dependencies, .metadata, .packages, pubspec.lock, build.yaml, analysis_options.yaml, all_lint_rules.yaml",
".gitignore": ".gitattributes, .gitmodules, .gitmessage, .mailmap, .git-blame*",
"readme.*": "authors, backers.md, changelog*, citation*, code_of_conduct.md, codeowners, contributing.md, contributors, copying, credits, governance.md, history.md, license*, maintainers, readme*, security.md, sponsors.md",
"*.dart": "$(capture).g.dart, $(capture).freezed.dart",
},
@amitkot
amitkot / sliverPersistentHeaderDelegate.dart
Created November 25, 2021 15:30 — forked from b-cancel/sliverPersistentHeaderDelegate.dart
SliverPersistentHeaderDelegate Example
/*
SliverPersistentHeader(
pinned: true,
floating: true,
delegate: OurDelegate(
toolBarHeight: MediaQuery.of(context).padding.top,
openHeight: 250,
closedHeight: 40,
),
),
@amitkot
amitkot / flipping_switch.dart
Created November 2, 2021 11:28
Flipping pill-shaped Switch in Flutter
import 'dart:math';
import 'package:flutter/material.dart';
class FlippingSwitch extends StatefulWidget {
const FlippingSwitch(
{required this.color,
required this.backgroundColor,
required this.firstLabel,
required this.secondLabel,
@amitkot
amitkot / timestamp_converter.dart
Last active June 20, 2021 07:28 — forked from slightfoot/timestamp_converter.dart
Timestamp/DateTime Converter for Cloud Firestore and Dart/Flutter.
// MIT License
//
// Copyright (c) 2020 Simon Lightfoot
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
@amitkot
amitkot / reverse_titles.py
Created July 27, 2020 11:14
A tool for reversing title values for fastlane frameit when using RTL languages
import re
from argparse import ArgumentParser
LINE_PATTERN = re.compile(r'"(.+)"\s*=\s*"(.+)"$')
def _parse_args():
parser = ArgumentParser(description='Reverse titles for frameit RTL')
parser.add_argument('--before', action='store', type=str, default='title.strings.before')
parser.add_argument('--output', action='store', type=str, default='title.strings')
@amitkot
amitkot / ffmpeg-watermark.md
Created April 30, 2020 21:47 — forked from bennylope/ffmpeg-watermark.md
FFmpeg add a watermark to video

How to Add a Watermark to Video

FFMPEG filters provide a powerful way to programmatically enhance or alter videos, and it’s fairly simple to add a watermark to a video using the overlay filter. The easiest way to install ffmpeg is to download a pre-built binary for your specific platform. Then you don’t have to worry about including and installing all the right dependencies and codecs you will be using.

Once you have ffmpeg installed, adding a watermark is as easy as passing your existing source through an overlay filter like so:

ffmpeg -i test.mp4 -i watermark.png -filter_complex "overlay=10:10" test1.mp4

Basically, we’re passing in the original video, and an overlay image as inputs, then passing it through the filter, and saving the output as test1.mp4.