Skip to content

Instantly share code, notes, and snippets.

@GhostofGoes
GhostofGoes / pyproject.toml
Last active June 5, 2024 16:17
Example pyproject.toml
# This example pyproject.toml is for a basic pip+setuptools setup.
# If you use a project management tool (like Poetry), then
# those tools will have slightly different configurations or additions.
# I highly recommend using a project management tool for your project.
# Project management is a highly opinionated subject.
# There are a lot of good, robust tools in this space now (as of 2023)
# Two that I've used and recommend are Poetry and PDM.
# Poetry is more mature, PDM is recent, both work well.
# - Poetry: https://python-poetry.org/

Google has an amazing free API endpoint for text completions ,

below are some examples of the completions I got and the python code to interact with the API

Star this gist if this was helpful to you. Enjoy text completions

user@linux:$ python3 google_text_completion.py
 > hackers are
hackers are watching you
@rain-1
rain-1 / LLM.md
Last active June 10, 2024 10:55
LLM Introduction: Learn Language Models

Purpose

Bootstrap knowledge of LLMs ASAP. With a bias/focus to GPT.

Avoid being a link dump. Try to provide only valuable well tuned information.

Prelude

Neural network links before starting with transformers.

@madebyollin
madebyollin / make_audiobook.py
Last active March 23, 2024 17:17
Converts an epub or text file to audiobook via Google Cloud TTS
#!/usr/bin/env python3
"""
To use:
1. install/set-up the google cloud api and dependencies listed on https://github.com/GoogleCloudPlatform/python-docs-samples/tree/master/texttospeech/cloud-client
2. install pandoc and pypandoc, also tqdm
3. create and download a service_account.json ("Service account key") from https://console.cloud.google.com/apis/credentials
4. run GOOGLE_APPLICATION_CREDENTIALS=service_account.json python make_audiobook.py book_name.epub
"""
import re
import sys
@roubachof
roubachof / AnchorBottomSheetBehavior.DragCallback.cs
Last active May 12, 2019 19:07
Xamarin Android - Google maps bottom sheet behavior, a BottomSheetBehavior with an added state - Xamarin port of google BottomSheetStyle
using System;
using Android.Support.V4.View;
using Android.Support.V4.Widget;
using Android.Views;
using Debug = System.Diagnostics.Debug;
namespace SillyCompany
{
public enum AnchorBottomSheetState
@paulirish
paulirish / what-forces-layout.md
Last active June 13, 2024 11:17
What forces layout/reflow. The comprehensive list.

What forces layout / reflow

All of the below properties or methods, when requested/called in JavaScript, will trigger the browser to synchronously calculate the style and layout*. This is also called reflow or layout thrashing, and is common performance bottleneck.

Generally, all APIs that synchronously provide layout metrics will trigger forced reflow / layout. Read on for additional cases and details.

Element APIs

Getting box metrics
  • elem.offsetLeft, elem.offsetTop, elem.offsetWidth, elem.offsetHeight, elem.offsetParent
@danalloway
danalloway / ssl.nginxconf
Last active May 15, 2017 12:37
Force full, secure SSL configuration on an NGINX site.
# capture HTTP requests to example.com and www.example.com
# and permanently redirect them to the HTTPS version of the site
#
server {
listen 80; # IPv4
listen [::]:80; # IPv6
server_name example.com www.example.com;
@staltz
staltz / introrx.md
Last active June 13, 2024 19:58
The introduction to Reactive Programming you've been missing
@markomanninen
markomanninen / Perseus Greek Isopsephy Project.ipynb
Last active September 22, 2017 02:51
Perseus Greek Isopsephy Project
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@su-v
su-v / gist:9965739
Last active June 14, 2023 08:34
Inkscape / SVG on GitHub