Skip to content

Instantly share code, notes, and snippets.

@danielgross
danielgross / specific_gpt.py
Created January 23, 2023 15:23
A chat interface that drives GPT-3 towards more specific answers.
"""Stream a response from the OpenAI completion API."""
import os
import re
import sys
import time
import random
import openai
openai.api_key = open(os.path.expanduser("~/.openai")).read().strip()
@MatthewVita
MatthewVita / gist:ea277dd2969f6cf291b481a1fd5eb818
Last active July 11, 2019 19:28
OpenEMR Rest API Dev Setup

Hi Sherwin and Daniel,

Sorry for my delayed response on this - I have been very ill. Follow these steps to get the REST API up and running so we can continue with some of the TODO items.

  1. Install Ubuntu on your computer or in a VirtualBox via https://itsfoss.com/install-linux-in-virtualbox/
  2. Install Docker:
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo apt-key fingerprint 0EBFCD88
@fabtho
fabtho / save_screenshot.py
Last active December 12, 2022 08:07
make full screenshot with selenium in python
#!/usr/bin/python
from selenium import webdriver
from PIL import Image
from cStringIO import StringIO
verbose = 1
browser = webdriver.Firefox()
browser.get('http://stackoverflow.com/questions/37906704/taking-a-whole-page-screenshot-with-selenium-marionette-in-python')
@sirbrillig
sirbrillig / pgsql_backup.sh
Last active November 15, 2025 02:29 — forked from dangerousbeans/pgsql_backup.sh
Postgresql daily backup script.
#!/bin/bash
#
# Backup a Postgresql database into a daily file.
#
BACKUP_DIR=/pg_backup
DAYS_TO_KEEP=14
FILE_SUFFIX=_pg_backup.sql
DATABASE=
USER=postgres
@UtahDave
UtahDave / saltsample_09252012_01
Created September 26, 2012 02:54 — forked from l2ol33rt/saltsample_09252012_01
Saltstack sample of using states and pillars for users
Here is a sample of how I am currently dealing with users.
Big thanks to uggedal! I used his user states as an example: https://github.com/uggedal/states
###
# How to create password hashes
###
python -c "import crypt; print crypt.crypt('password', '\$6\$SALTsalt\$')"
###
@jordansissel
jordansissel / Procfile
Created April 5, 2012 19:29
Jenkins on Heroku
# Only listen on http; disable ajp and https
web: java -jar jenkins.war --httpPort=$PORT --ajp13Port=-1 --httpsPort=-1