Helpful tools:
brew install git postgresql
parse_git_branch() { | |
git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/(\1)/' | |
} | |
PS1="\[\033[0m\]\w\[\033[34m\] \$(parse_git_branch)\[\033[01;36m\]:\[\033[00m\] " |
#!/bin/sh | |
# Called by "git push" after it has checked the remote status, | |
# but before anything has been pushed. | |
# | |
# If this script exits with a non-zero status nothing will be pushed. | |
# | |
# Steps to install, from the root directory of your repo... | |
# 1. git config --global init.templatedir '~/.git-templates' | |
# 2. mkdir -p ~/.git-templates/hooks |
#!/usr/bin/env bash | |
for branch in `git checkout --quiet master && git branch -r --merged | grep origin/ | sed 's/origin\///' | sed '1d;$d' | grep --invert-match master`; do echo -e `git push origin --delete $branch` \\t$branch; done |
#!/bin/sh | |
# Called by "git push" after it has checked the remote status, | |
# but before anything has been pushed. | |
# | |
# If this script exits with a non-zero status nothing will be pushed. | |
# | |
# Steps to install, from the root directory of your repo... | |
# 1. git config --global init.templatedir '~/.git-templates' | |
# 2. mkdir -p ~/.git-templates/hooks |
Helpful tools:
brew install git postgresql
~/vagrant-setup (master): vagrant plugin install vagrant-hostsupdater | |
Installing the 'vagrant-hostsupdater' plugin. This can take a few minutes... | |
Bundler, the underlying system Vagrant uses to install plugins, | |
reported an error. The error is shown below. These errors are usually | |
caused by misconfigured plugin installations or transient network | |
issues. The error from Bundler is: | |
An error occurred while installing json (1.8.1), and Bundler cannot continue. | |
Make sure that `gem install json -v '1.8.1'` succeeds before bundling. |
#! /usr/bin/ruby | |
require 'fileutils' | |
path = "/etc/hosts" | |
sites = %w( | |
news.ycombinator.com | |
reddit.com | |
www.reddit.com |
#!/usr/bin/env python3 | |
# Note: if spacy isn't working you may need to download english model python -m spacy download en | |
import argparse | |
import json | |
from langchain.text_splitter import NLTKTextSplitter, CharacterTextSplitter, RecursiveCharacterTextSplitter, SpacyTextSplitter, TokenTextSplitter | |
def chunkify(text, chunk_size, chunk_overlap, method): | |
if method == 'nltk': | |
text_splitter = NLTKTextSplitter.from_tiktoken_encoder( |