Skip to content

Instantly share code, notes, and snippets.

View jdholdren's full-sized avatar
🐙

James Holdren jdholdren

🐙
View GitHub Profile
@jdholdren
jdholdren / completion.lua
Created July 23, 2025 13:30
Most minimally useful nvim setup
-- Goes in lua/completion.lua
vim.api.nvim_create_autocmd('LspAttach', {
callback = function(ev)
local client = vim.lsp.get_client_by_id(ev.data.client_id)
if client:supports_method('textDocument/completion') then
vim.lsp.completion.enable(true, client.id, ev.buf, { autotrigger = true })
end
end,
})
@jdholdren
jdholdren / server.go
Last active July 10, 2020 16:36 — forked from viggin543/server.go
//# the service
package main
import (
"database/sql"
"fmt"
"net/http"
"github.com/gin-gonic/gin"
_ "github.com/go-sql-driver/mysql"
module Parser where
import Text.ParserCombinators.Parsec hiding (spaces)
import System.Environment
import Data.Char
data Token
= Verb VerbVal
| Article
| Noun String
@jdholdren
jdholdren / example1.scala
Created February 28, 2019 20:09 — forked from bkyrlach/example1.scala
Monad examples in Scala
sealed trait MonadOps[M[_]] {
// functor
def pure[A](a: A): M[A]
def map[A,B](ma: M[A])(f: A => B): M[B]
// monad
def flatMap[A,B](ma: M[A])(f: A => M[B]): M[B]
}
case class Id[A](a: A)
@jdholdren
jdholdren / main.hs
Created February 12, 2019 06:27
Fib in linear time
next :: [Integer] -> Integer
next (x:(s:_)) = x + s
loop :: Integer -> [Integer] -> [Integer]
loop 0 l = l
loop n l = loop (n-1) ((next l):l)
fib :: Integer -> [Integer]
fib 0 = []
fib 1 = [0]

Keybase proof

I hereby claim:

  • I am jdholdren on github.
  • I am jdoldren (https://keybase.io/jdoldren) on keybase.
  • I have a public key ASCkI9cLyQ1Osdvsl8otStNVNlPYYLdVHZgNk8hWIYOHjwo

To claim this, I am signing this object:

import android.Manifest;
import android.content.Context;
import android.content.pm.PackageManager;
import android.location.Location;
import android.os.Bundle;
import android.support.annotation.NonNull;
import android.support.annotation.Nullable;
import android.support.v4.content.ContextCompat;
import com.google.android.gms.common.ConnectionResult;
# Declaration of variables
CC = g++
CC_FLAGS = -w
BUILD_DIR = ./build
MAKE_DIR = mkdir -p
# File names
EXEC = a
SOURCES = $(wildcard src/*.cpp)
OBJECTS = $(SOURCES:.cpp=.o)