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 / 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/
@dylan-k
dylan-k / firstLast.sql
Created April 9, 2018 22:25 — forked from mrclay/firstLast.sql
MySQL: Extract last and first name(s) from a full "name" field (for Elgg)
SELECT
-- Assumed to be trimmed
name
-- Does name contain multiple words?
,(LOCATE(' ', name) = 0) AS hasMultipleWords
-- Returns the end of the string back until reaches a space.
-- E.g. "John Doe" => "Doe"
-- E.g. "Francis Scott Key" => "Key"
@dylan-k
dylan-k / dev_setup.ps1
Created August 9, 2017 19:37 — forked from thitemple/dev_setup.ps1
A PowerShell script for installing a dev machine using Chocolatey.
function Add-Path() {
[Cmdletbinding()]
param([parameter(Mandatory=$True,ValueFromPipeline=$True,Position=0)][String[]]$AddedFolder)
# Get the current search path from the environment keys in the registry.
$OldPath=(Get-ItemProperty -Path 'Registry::HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Session Manager\Environment' -Name PATH).Path
# See if a new folder has been supplied.
if (!$AddedFolder) {
Return 'No Folder Supplied. $ENV:PATH Unchanged'
}
# See if the new folder exists on the file system.