Skip to content

Instantly share code, notes, and snippets.

View mzagaja's full-sized avatar

Matthew Zagaja mzagaja

View GitHub Profile
@noelrappin
noelrappin / Dockerfile
Created May 10, 2022 11:30
Docker Setup for workshop
# syntax=docker/dockerfile:1
FROM ruby:3.1.2
RUN apt-get update -qq && apt-get install -y sqlite3
WORKDIR /myapp
COPY Gemfile /myapp/Gemfile
COPY Gemfile.lock /myapp/Gemfile.lock
RUN bundle install
# Add a script to be executed every time the container starts.
COPY entrypoint.sh /usr/bin/
@chriswhong
chriswhong / README.md
Created February 28, 2020 17:55
Using ogr2ogr to load a CSV into Postgres

The absolute easiest way to get a CSV into a postgresql table is to use ogr2ogr with AUTODETECT_TYPE=YES.

I learned a while back that this is what cartoDB uses to import your CSV into postgis (with a lot of other parameters added)

ogr2ogr -f PostgreSQL PG:"host=localhost user=postgres dbname=postgres password=password"  docs.csv -oo AUTODETECT_TYPE=YES
@coco98
coco98 / track_all_tables.py
Last active September 16, 2021 19:24
Track tables in python (Hasura)
import requests
#Fetch existing tables
tables = requests.post('http://localhost:8080/v1/query', json={
"type":"select",
"args":{
"table": {"schema": "information_schema", "name": "tables"},
"columns": ["table_name"],
"where": {"table_schema": {"$eq": "public"}}
}
@odlp
odlp / bundler-rspec-inline.rb
Created August 9, 2018 09:43
Inline Bundler and autorun RSpec
require "bundler/inline"
gemfile do
gem "rspec"
end
require "rspec/autorun"
RSpec.describe "inline Bundler and autorun RSpec" do
it "is convenient for self-contained examples & bug repros" do