Skip to content

Instantly share code, notes, and snippets.

@dylan-k
dylan-k / csv2bib.py
Created January 15, 2025 16:51 — forked from mikeesto/csv2bib.py
Convert CSV file to BibTeX
import csv
def generate_bibtex_key(authors, year):
"""Generate a BibTeX key from the first author's last name and the year"""
last_names = authors.split(",")[0].split()
last_name = last_names[-1] if len(last_names) > 0 else ""
return f"{last_name.lower()}{year}"
def convert_csv_to_bibtex(csv_file, bibtex_file):
"""Convert a CSV file to BibTeX format"""
@dylan-k
dylan-k / latex.template
Created April 1, 2022 13:39 — forked from michaelt/latex.template
Template for Pandoc LaTeX File
%!TEX TS-program = xelatex
\documentclass[12pt]{scrartcl}
% The declaration of the document class:
% The second line here, i.e.
% \documentclass[12pt]{scrartcl}
% is a standard LaTeX document class declaration:
% we say what kind of document we are making in curly brackets,
% and specify any options in square brackets.
@dylan-k
dylan-k / contract-template.md
Last active April 1, 2022 13:37
Template for Contract

The contract

Between [company name]

And [customer name]

Summary

I will always do my best to fulfill your needs and meet your expectations, but it's important to have things written down so that we both know what's what, who should do what and when, and what will happen if something goes wrong.

@dylan-k
dylan-k / README-Template.md
Last active April 1, 2022 13:37 — forked from PurpleBooth/README-Template.md
Template for README file

Project Title

One Paragraph of project description goes here

Getting Started

These instructions will get you a copy of the project up and running.

@dylan-k
dylan-k / 00-vim-keys.md
Last active October 15, 2024 23:45
Make Vim Use "Normal" Keyboard Shortcuts

Make Vim use Normal Keyboard Shortcuts

All my life I've used VXCZ keys for paste, cut, copy, undo. To me, that's what's "normal." There's a name for that style of key bindings. They're called Common User Access, or CUA.

I'd like to use vim as the text editor for the very fast writing laptop I'm putting together. My goal is startup speed with low resource usage, and vim has got that. I'm just getting started and there's a lot to learn...

But, no, thank you, I don't want to learn all-new keyboard shortcuts, because my goal is speed and learning them will slow me down and worse, it'll frustrate me, and besides I don't need to learn that right now. (I'll wait while some computer fundamentalists contain their emotions or depart.)

I'm not against learning new shortcuts gradually over time, and I'm also not against taking some time to set it up so I don't have to, at least not at first, perhaps not ever. After all, aren't we supposed to be able to customi

@dylan-k
dylan-k / barebones-ubuntu.md
Created November 9, 2021 18:28
Very Minimal Barebones Ubuntu 20.04 with i3 Window Manager

INSTALLING A BAREBONES UBUNTU

This is an configuration for an old laptop. The goal here is to make a "writing machine" so I can go from "zero to writing" in as few seconds as possible. It's a learning-as-I go project. Suggestions welcome.

Requirements:

  • fastest possible startup
  • auto login
@dylan-k
dylan-k / git-clearHistory
Created September 19, 2019 20:39 — forked from stephenhardy/git-clearHistory
Steps to clear out the history of a git/github repository
-- Remove the history from
rm -rf .git
-- recreate the repos from the current content only
git init
git add .
git commit -m "Initial commit"
-- push to the github remote repos ensuring you overwrite history
git remote add origin [email protected]:<YOUR ACCOUNT>/<YOUR REPOS>.git
<?php
function my_find_expired_events( $ids ) {
$args = array(
'post_type' => 'tribe_events',
'nopaging' => true,
'fields' => 'ids',
'meta_query' => array(
array(
@dylan-k
dylan-k / .htaccess
Created March 20, 2019 19:57 — forked from ScottPhillips/.htaccess
Common .htaccess Redirects
#301 Redirects for .htaccess
#Redirect a single page:
Redirect 301 /pagename.php http://www.domain.com/pagename.html
#Redirect an entire site:
Redirect 301 / http://www.domain.com/
#Redirect an entire site to a sub folder
Redirect 301 / http://www.domain.com/subfolder/