Skip to content

Instantly share code, notes, and snippets.

View alexkreidler's full-sized avatar
🎯
Focusing

Alex Kreidler alexkreidler

🎯
Focusing
View GitHub Profile
@alanzchen
alanzchen / convert.py
Created September 1, 2021 23:03
Convert Word with Zotero citation to Markdown. Step 1: https://www.zotero.org/support/kb/moving_documents_between_word_processors Step 2: Convert the docx to Markdown via pandoc with "--wrap=none". Step 3: Use this script to process the markdown file.
#!/usr/bin/env python3
import sqlite3
import re
import json
import argparse
def convert(db, filename):
con = sqlite3.connect(db)
cur = con.cursor()
with open(filename, "r") as f:
@ksopyla
ksopyla / install_cuda_11_ubuntu_2004.md
Last active April 27, 2024 21:43
How to install CUDA toolkit 11 at ubuntu 20.04

Step by step instruction how to install CUDA 11 Ubuntu 20.04

NVidia Ubuntu 20.04 repository for CUDA 11

If you need CUDA Tolkit 11 with nvcc, other tools and libraries you can install it from NVIDIA Ubunutu 20.04 repository.

Add Ubuntu 20.04 repository

@niloch
niloch / df_pydantic_validate.ipynb
Created July 22, 2020 16:13
DataFrame Validation with Pydantic (including self validating dataframs)
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@kohenkatz
kohenkatz / generate_ulid_text.sql
Created April 28, 2020 06:29
Postgres stuff for working with ULID
-- From https://github.com/geckoboard/pgulid/blob/d6187a00f66dca196cf5242588f87c3a7969df75/pgulid.sql
--
-- pgulid is based on OK Log's Go implementation of the ULID spec
--
-- https://github.com/oklog/ulid
-- https://github.com/ulid/spec
--
-- Copyright 2016 The Oklog Authors
-- Licensed under the Apache License, Version 2.0 (the "License");
-- you may not use this file except in compliance with the License.
@rvaidya
rvaidya / database_to_parquet.py
Last active June 27, 2024 08:01
Dump database table to parquet file using sqlalchemy and fastparquet. Useful for loading large tables into pandas / Dask, since read_sql_table will hammer the server with queries if the # of partitions/chunks is high. Using this you write a temp parquet file, then use read_parquet to get the data into a DataFrame
import pandas as pd
import numpy as np
import fastparquet
from sqlalchemy import create_engine, schema, Table
# Copied from pandas with modifications
def __get_dtype(column, sqltype):
import sqlalchemy.dialects as sqld
@derhuerst
derhuerst / 1-benchmark.js
Last active March 14, 2022 21:16
JS bloom filters benchmark
'use strict'
const {randomBytes} = require('crypto')
const {Suite} = require('benchmark')
const {ok} = require('assert')
const Farmfilter = require('farmfilter')
const XXBloom = require('xxbloom')
const JSBloom = require('jsbloom').filter
const Orlando = require('orlando')

GraphQL-LD

GraphQL-LD is a way to query Linked Data using GraphQL.

Instead of querying GraphQL interfaces, Linked Data interfaces are queried, such as SPARQL endpoints, TPF interfaces, Linked Data documents, ... This is done by semantifying GraphQL queries using a JSON-LD context.

Try it out from your browser: http://query.linkeddatafragments.org/

Alternatively, install GraphQL-LD or Comunica SPARQL and execute GraphQL-LD queries on your machine

@AbsoluteDestiny
AbsoluteDestiny / 01. Download Locations for FFmpeg.md
Last active March 16, 2023 12:54
Some FFMpeg commands I need to remember for converting footage for video editing. http://bit.ly/vidsnippets
@begriffs
begriffs / pg-count-perf.md
Created October 12, 2016 00:32
Faster PostgreSQL Counting
title date author tags syndicate
Faster PostgreSQL Counting
2016-10-12
Joe Nelson
true

Everybody counts, but not always quickly. This article is a close look into how PostgreSQL optimizes counting. If you know the tricks

==========================
How Software Companies Die
==========================
- Orson Scott Card
The environment that nurtures creative programmers kills management and
marketing types - and vice versa.
Programming is the Great Game. It consumes you, body and soul. When
you're caught up in it, nothing else matters. When you emerge into