Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am nicholastmosher on github.
  • I am nicholastmosher (https://keybase.io/nicholastmosher) on keybase.
  • I have a public key ASAbPPk2jH7OiuMti5rQ52q0azR1I0QXil1sxey6uA3c_Ao

To claim this, I am signing this object:

impl<'a, A, B> JSValue<'a> for (A, B)
where
A: JSValue<'a>,
B: JSValue<'a>,
{
fn convert_to_rust(env: &'a JsEnv, js_value: napi_value) -> Result<Self, NjError> {
use crate::sys::napi_get_array_length;
if !env.is_array(js_value)? {
return Err(NjError::Other("not array".to_owned()));
}
@nicholastmosher
nicholastmosher / July2019-Cluesheet.md
Created July 27, 2019 17:21
CSH-Summer2019-Cluesheet

CSH 2019 July hackathon clue sheet

General

  • +100: Working on a brand new project for the hackathon
  • +50: Group project
  • +1-100: The triangle (benefit to house, amount learned, time spent)
  • +10: Long overdue
    • +1: Days
    • +10: Months
  • +100: Years

Git model:

Here's a simple way to think of git as a data structure rather than a magic box (not using any particular syntax):

history: Map<Hash, Commit>
Commit {
  changes: Diff,
  previous: Hash,
@nicholastmosher
nicholastmosher / BusinessLaw.md
Last active September 17, 2018 21:44
Notes for Business Law

Chapter 1: Introduction to Law and Legal Reasoning

S1: Business Activities and the Legal Environment

Definitions:

Breach: to break or fail to perform the requirements of a contract

S2: Sources of American Law

OAuth Usability

@nicholastmosher
nicholastmosher / kakrc
Created July 7, 2017 03:55
Asynchronous fzf backed by ripgrep
def -docstring 'invoke fzf to open a file' \
fzf-file %{
%sh{
if [ -z "$TMUX" ]; then
echo echo only works inside tmux
else
(
FILE=$(rg --files --hidden | fzf-tmux -d 15)
if [ -n "$FILE" ]; then
printf 'eval -client %%{%s} edit %%{%s}\n' "${kak_client}" "${FILE}" | kak -p "${kak_session}"
@nicholastmosher
nicholastmosher / kakenv
Last active February 9, 2017 00:50
Use Kakoune install on RIT CS machines.
# Add this to your PATH on your CS account to gain access to "kak".
# Kakoune configurations still live in your `~/.config/kak/` directory.
export PATH="~ntm8772/usr/local/bin:$PATH"
# On the server (i.e. playback device), find the sink number by running:
pactl list short sinks
# Open that sink on a port (e.g. 1234) to be accessed remotely:
pactl load-module module-native-protocol-tcp port=1234 auth-anonymous=1
# Make sure you know the ip address of your server device:
ifconfig
# On the client (i.e. the device with the audio application), connect to the remote sink: