Skip to content

Instantly share code, notes, and snippets.

@skoudoro
skoudoro / langchain_qa_chatgpt_bot.py
Created August 16, 2023 22:18 — forked from czue/langchain_qa_chatgpt_bot.py
sample code for chatgpt / gpt4 langchain Q&A
# see https://www.youtube.com/watch?v=CsFpVdgEXCU for details of what this does
from typing import List
from langchain import ConversationChain
from langchain.chat_models import ChatOpenAI
from langchain.indexes.vectorstore import VectorStoreIndexWrapper
from langchain.memory import ConversationBufferMemory
from langchain.prompts import (
ChatPromptTemplate,
@skoudoro
skoudoro / pep20_by_example.py
Created May 31, 2020 12:09 — forked from evandrix/pep20_by_example.py
PEP 20 (The Zen of Python) by example
#!/usr/bin/env python
"""
=====================================
PEP 20 (The Zen of Python) by example
=====================================
Usage: %prog
:Author: Hunter Blanks, hblanks@artifex.org / hblanks@monetate.com
@skoudoro
skoudoro / branch-fu.md
Created May 26, 2020 19:42 — forked from unbracketed/branch-fu.md
Moving commits between branches

Example: Moving up to a few commits to another branch

Branch A has commits (X,Y) that also need to be in Branch B. The cherry-pick operations should be done in the same chronological order that the commits appear in Branch A.

cherry-pick does support a range of commits, but if you have merge commits in that range, it gets really complicated

git checkout branch-B
git cherry-pick X
git cherry-pick Y
@skoudoro
skoudoro / markdown_doc
Created January 10, 2020 21:24 — forked from jiffyclub/markdown_doc
This script turns Markdown into HTML using the Python markdown library and wraps the result in a complete HTML document with default Bootstrap styling so that it's immediately printable. Requires the python libraries jinja2, markdown, and mdx_smartypants.
#!/usr/bin/env python
import argparse
import sys
import jinja2
import markdown
TEMPLATE = """<!DOCTYPE html>
<html>
@skoudoro
skoudoro / main.qml
Last active December 18, 2019 20:16 — forked from rostikL/main.qml
QQuickFramebufferObject
import QtQuick 2.3
import Renderer 1.0
Item {
width: 500
height: 600
FBORenderer{
id: fboRenderItem
anchors.fill: parent
@skoudoro
skoudoro / bobp-python.md
Created August 26, 2019 19:56 — forked from sloria/bobp-python.md
A "Best of the Best Practices" (BOBP) guide to developing in Python.

The Best of the Best Practices (BOBP) Guide for Python

A "Best of the Best Practices" (BOBP) guide to developing in Python.

In General

Values

  • "Build tools for others that you want to be built for you." - Kenneth Reitz
  • "Simplicity is alway better than functionality." - Pieter Hintjens
@skoudoro
skoudoro / trk2tck.py
Created February 13, 2018 20:06 — forked from MarcCote/trk2tck.py
Script that converts TRK to TCK using https://github.com/MarcCote/nibabel/tree/streamlines_tck
import os
import argparse
import nibabel as nib
def build_argparser():
DESCRIPTION = "Convert tractograms (TRK -> TCK)."
p = argparse.ArgumentParser(description=DESCRIPTION)
p.add_argument('tractograms', metavar='bundle', nargs="+", help='list of tractograms.')
p.add_argument('-f', '--force', action="store_true", help='overwrite existing output files.')
@skoudoro
skoudoro / tck2trk.py
Created February 13, 2018 20:04 — forked from MarcCote/tck2trk.py
Script that converts TCK to TRK using https://github.com/MarcCote/nibabel/tree/streamlines_tck
import os
import argparse
import nibabel as nib
from nibabel.streamlines import Field
from nibabel.orientations import aff2axcodes
def build_argparser():
DESCRIPTION = "Convert tractograms (TCK -> TRK)."