Goals: Add links that are reasonable and good explanations of how stuff works. No hype and no vendor content if possible. Practical first-hand accounts of models in prod eagerly sought.
require 'json' | |
require 'dry-schema' | |
require 'openai' | |
require 'ostruct' | |
module StructuredOutputs | |
# Schema class for defining JSON schemas | |
class Schema | |
MAX_OBJECT_PROPERTIES = 100 | |
MAX_NESTING_DEPTH = 5 |
I started a project on a Hobby Dev plan (free, limit 10,000 rows), and then later needed to upgrade it to Hobby Basic ($9/month, limit 10,000,000 rows).
After assigning the new database, I had two databases attached to the application. They looked something like this:
- HEROKU_POSTGRESQL_OLIVE (postgresql-dimensional-3321) Old, free-tier (Hobby Dev) database
#!/bin/sh | |
# 0. create a channel you want to import to | |
# 1. first you get token and channel_id from slack's API page | |
# 2. then you run the script | |
# 3. while it is running, you export your team data, delete everything except one channels.json, users.json and one dir for you channel | |
# 4. then manually (sorry guys) craft json and put it into channel dir | |
# 5. make zip and upload it to import | |
# 6. profit | |
token= | |
channel_id= |
Custom recipe to get OS X 10.10 Yosemite running from scratch, setup applications and developer environment. I use this gist to keep track of the important software and steps required to have a functioning system after a semi-annual fresh install. On average, I reinstall each computer from scratch every 6 months, and I do not perform upgrades between distros.
This keeps the system performing at top speeds, clean of trojans, spyware, and ensures that I maintain good organizational practices for my content and backups. I highly recommend this.
You are encouraged to fork this and modify it to your heart's content to match your own needs.
Many thanks to https://github.com/jadekler/git-go-websiteskeleton who got me started in this direction. Jadekler was in turn inspired by https://gist.github.com/cespare/3985516. Ultimately, this implementation has a lot more in common with cespare's. There are a few minor differences. I mainly wrote this one to teach myself exactly what was going on (hence all the comments) and to demonstrate the inclusion of the gorilla/mux framework without using Jadekler's technique of two separate http muxes.
#!/usr/bin/python | |
# -*- coding: utf-8 -*- | |
# Python script to find the largest files in a git repository. | |
# The general method is based on the script in this blog post: | |
# http://stubbisms.wordpress.com/2009/07/10/git-script-to-show-largest-pack-objects-and-trim-your-waist-line/ | |
# | |
# The above script worked for me, but was very slow on my 11GB repository. This version has a bunch | |
# of changes to speed things up to a more reasonable time. It takes less than a minute on repos with 250K objects. | |
# |
package controllers | |
import ( | |
"bytes" | |
"image" | |
"image/gif" | |
"image/jpeg" | |
"image/png" | |
"io" | |
"net/http" |
Here is a high level overview for what you need to do to get most of an Android environment setup and maintained.
Prerequisites (for Homebrew at a minimum, lots of other tools need these too):
- XCode is installed (via the App Store)
- XCode command line tools are installed (
xcode-select --install
will prompt up a dialog) - Java
Install Homebrew:
ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)"
script_file = File.join(Rails.root, "script", "git_fix_whitespace.sh") | |
desc "Remove trailing whitespace and convert tabs to spaces" | |
task :fix_whitespace do | |
`sh #{script_file} -f` | |
end | |
namespace :fix_whitespace do | |
desc "Installs a git pre-commit hook which removes trailing whitespace and converts tabs to spaces" | |
task :install, :force do |t, args| |