Skip to content

Instantly share code, notes, and snippets.

View ats's full-sized avatar

Alan Schussman ats

View GitHub Profile
@ats
ats / ginit.vim
Created August 16, 2022 14:03
nvim/vimr config file ~/.config/nvim/ginit.vim
" Fix key mapping issues for GUI
inoremap <silent> <S-Insert> <C-R>+
cnoremap <S-Insert> <C-R>+
nnoremap <silent> <C-6> <C-^>
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" config for nvim-qt "
""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""
" To check if neovim-qt is running, use `exists('g:GuiLoaded')`,
" see https://github.com/equalsraf/neovim-qt/issues/219
@ats
ats / .tmux.conf
Created May 7, 2022 02:45
old tux configuration
###############################################################################
################################## PREFIX ####################################
###############################################################################
unbind C-b
set -g prefix `
bind -r ` send-prefix
###############################################################################
################################## SETTINGS ###################################
@ats
ats / .vimrc
Last active August 16, 2022 14:02
" .vimrc
" This began as a "minimal vimrc for new vim users to start with" at
" http://vimuniversity.com/samples/your-first-vimrc-should-be-nearly-empty
"
" But that URL no longer exists.
"
" Original Author: Bram Moolenaar <Bram@vim.org>
" Made more minimal by: Ben Orenstein
" Modified by : Ben McCormick
" Last change by ats: March 21, 2021
@ats
ats / media-endpoint.php
Last active March 5, 2018 03:42 — forked from aaronpk/media-endpoint.php
an example of a Micropub Media Endpoint https://www.w3.org/TR/micropub/#media-endpoint
<?php
$token_endpoint = 'https://tokens.indieauth.com/token';
$base_url = 'https://media.prettygoodhat.com/';
header('Access-Control-Allow-Origin: *');
header('Access-Control-Allow-Headers: Authorization');
if(isset($_SERVER['HTTP_ACCEPT']) && strpos($_SERVER['HTTP_ACCEPT'], 'text/plain') !== false) {
$format = 'text';

Day One Today template

This creates a new entry with the following content in Day One. I run it via a Launch Center action:

# Today Template
## What is happening today? (work/home)
## What did I do yesterday?
## How do I feel?
## What is most valuable and concrete today? What action will advance the most important thing for me today?
@ats
ats / gist:8499989
Created January 19, 2014 03:04
Bare-bones TextMate command to run the current markdown file through pandoc with a hardcoded LaTeX template.
#!/bin/bash
name="$TM_FILENAME"
barename="${name%.*}"
pandoc --read=markdown -s $TM_FILEPATH --output=$TM_DIRECTORY/$barename.pdf --template=$TM_DIRECTORY/template-tufte.tex --latex-engine=xelatex
@ats
ats / Runkeeper_API_startup.md
Created May 8, 2013 04:00
Runkeeper API startup guide: I ran into some hitches with the Runkeeper API while building a plugin to hook it to Slogger, so I wrote a quick guide to accompany the plugin itself.

Runkeeper API startup

Begin with the Runkeeper Registration/Authorization page for general instructions to get started. This page points to the Application Portal you can use to establish your application. You'll obtain client_id and client_secret by registering a personal application in that portal.

Then obtain code by submitting a request to https://runkeeper.com/apps/authorize with the following parameters directly from the Runkeeper instructions:

  • client_id: The unique identifier that your application received upon registration
  • code: code
  • redirect_uri: The page on your site where the Health Graph API should redirect the user after accepting or denying the access request
@ats
ats / mover.rb
Created April 27, 2013 21:48
Command-line tool for browsing, downloading and uploading using the mover.io API. Requires a move.io account, a linked storage space (i.e. a "connector" such as Dropbox) and private user API keys available with the mover.io account.
#!/usr/bin/ruby
# mover.rb
# general purpose utility for finding, getting and uploading files using the mover.io API.
# YAML config file is required in ~/.mover, contains API IDs and keys provided by mover.io. Example db.yaml:
# ---
# connector: mover_connector_ID
# app_id: mover_user_app_ID
# app_secret: mover_user_secret_key
@ats
ats / gist:1431723
Created December 5, 2011 00:04
Dirt-simple TextMate snippet for Markdown/Calepin header
Title: $1
Date: ${2:`date +%Y-%m-%d`}
Slug: ${3:post-slug}
Status: draft
$4
@ats
ats / babynames.r
Created May 2, 2010 23:06
Quick stab at tracking specific names in the baby names data
# 2010-05-02 baby name exploration
# data from http://github.com/hadley/data-baby-names/
bnames <- read.csv("~/data/data-baby-names/baby-names.csv") // path to data
library(ggplot2)
wantedNames <- c("Page", "Plant") // set a list of names to plot over time
gotNames <- subset(bnames, bnames$name %in% wantedNames)
p <- ggplot(gotNames, aes(x=year, y=percent*100))