Skip to content

Instantly share code, notes, and snippets.

View efvincent's full-sized avatar

Eric Vincent efvincent

View GitHub Profile
@efvincent
efvincent / DSLR_webcam_arch_linux.md
Created November 28, 2023 23:04 — forked from keilmillerjr/DSLR_webcam_arch_linux.md
Using DSLR as a webcam on Arch/Manjaro Linux
Inductive partial_map : Type :=
| Empty
| Binding (k : nat) (v : nat) (m : partial_map).
(** update given in the lecture. map will continue to grow, updated
pairs aren't removed - not a realistic representation is it? *)
Definition update' (k v : nat) (m : partial_map) : partial_map :=
Binding k v m.
(** alternative that replaces the updated node at the key *)
@efvincent
efvincent / multiple_ssh_setting.md
Created February 14, 2022 20:45 — forked from jexchan/multiple_ssh_setting.md
Multiple SSH keys for different github accounts

Multiple SSH Keys settings for different github account

create different public key

create different ssh key according the article Mac Set-Up Git

$ ssh-keygen -t rsa -C "your_email@youremail.com"
@efvincent
efvincent / hw.c
Last active May 24, 2021 19:47
GDB hang on Mac Big Sur 11.3.1
/* repro:
1. compile with $ cc -std=c99 -ggdb3 -Wall hw.c -o hw
1a. also tried with clang, same thing
2. debug with $ gdb hw
3. step into main (gdb) start
you'll get some variation of a hang like this:
Temporary breakpoint 1 at 0x100003f6f: file hw.c, line 4.
@efvincent
efvincent / purescript.jsonc
Last active February 5, 2022 23:06 — forked from galtsev/purescript.json
purescript unicode snippets for vscode
{
/*
// Place your snippets for PureScript here. Each snippet is defined under a snippet name and has a prefix, body and
// description. The prefix is what is used to trigger the snippet and the body will be expanded and inserted. Possible variables are:
// $1, $2 for tab stops, $0 for the final cursor position, and ${1:label}, ${2:another} for placeholders. Placeholders with the
// same ids are connected.
// Example:
"Print to console": {
"prefix": "log",
"body": [
@efvincent
efvincent / remapping.ahk
Created February 16, 2020 07:44
Remapping script for AutoHotKey - close window and alt-tab behavior
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
#Warn ; Enable warnings to assist with detecting common errors.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
;
; This assumes the CTRL and ALT keys have been switched using registry mapping. KeyTweak does the job
; if you don't want to manually tweak the mappings in the registry yourself.
;
^q::WinClose, A ; Close the current Window using CTRL-Q like on the mac
@efvincent
efvincent / LogicalContext.cs
Created March 14, 2017 18:03
Logical context from an old project
#pragma warning disable 1584,1711,1572,1581,1580
using System;
using System.Runtime.Remoting.Messaging;
using System.Runtime.Serialization;
namespace Cfx.Core {
/// <summary>
/// Provides a means to store data in a logical context.
/// </summary>
@efvincent
efvincent / Result.fs
Created December 6, 2016 14:38
Result type functions
type Result<'T,'TError> =
| Ok of ResultValue:'T
| Error of ErrorValue:'TError
let map (fn:'T -> 'U) (result:Result<'T, 'TError>) =
match result with
| Ok r -> Ok (fn r)
| Error e -> Error e
[<CompiledName("MapError")>]
@efvincent
efvincent / tempDB-file-perf.sql
Last active October 11, 2015 20:24
TempDB file performance
SELECT files.physical_name, files.name,
stats.num_of_writes, (1.0 * stats.io_stall_write_ms / stats.num_of_writes) AS avg_write_stall_ms,
stats.num_of_reads, (1.0 * stats.io_stall_read_ms / stats.num_of_reads) AS avg_read_stall_ms
FROM sys.dm_io_virtual_file_stats(2, NULL) as stats
INNER JOIN master.sys.master_files AS files
ON stats.database_id = files.database_id
AND stats.file_id = files.file_id
WHERE files.type_desc = 'ROWS'
;;; init --- my init file
;;; Commentary:
; Eric F. Vincet
; Current init file, cobbled together mostly from http://howardabrams.com/projects/dot-files/emacs.html
;;; Code:
(setq user-mail-address "eric@efvincent.com")
(setq user-full-name "Eric F. Vincent")