Skip to content

Instantly share code, notes, and snippets.

View jdvala's full-sized avatar

Jay Vala jdvala

View GitHub Profile
@jdvala
jdvala / .vimrc
Created April 23, 2021 11:32 — forked from simonista/.vimrc
A basic .vimrc file that will serve as a good template on which to build.
" Don't try to be vi compatible
set nocompatible
" Helps force plugins to load correctly when it is turned back on below
filetype off
" TODO: Load plugins here (pathogen or vundle)
" Turn on syntax highlighting
syntax on
@jdvala
jdvala / jq_jsonl_conversion.md
Created September 29, 2020 11:14 — forked from sloanlance/jq_jsonl_conversion.md
jq: JSONL ↔︎ JSON conversion

jq: JSONL ↔︎ JSON conversion

  1. JSONL → JSON

    jq -s '.' input.jsonl > output.json
  2. JSON → JSONL

jq -c '.[]' input.json > output.jsonl

@jdvala
jdvala / test_mock.py
Created June 12, 2020 09:39 — forked from tomschr/test_mock.py
Example of mocking os.path.isfile
#!/usr/bin/env python3
#
# Use py.test:
# $ py.test test_mock.py
from unittest.mock import patch
import os.path
def my_isfile(filename):
@jdvala
jdvala / stateful_lstm_embedding.py
Created February 1, 2019 16:01 — forked from stefanthaler/stateful_lstm_embedding.py
Simple example for a stateful keras LSTM with embedding.
"""
Learning Task:
Given a sequence, predict a label based on the first value of the sequence
Explanation of stateful LSTM and setup:
http://philipperemy.github.io/keras-stateful-lstm/
Exmple:
given a sequence [1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], predict 1
given a sequence [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0], predict 0