Skip to content

Instantly share code, notes, and snippets.

@tharna
tharna / streak.js
Last active January 12, 2021 09:03
Check streak
if(user.lastPost) {
let lastDate = new Date(JSON.parse(user.lastPost))
lastDate.setHours(0, 0, 0)
lastDate.setMilliseconds(0)
lastDate.setMinutes(-(data.offset))
let currentDate = new Date()
currentDate.setDate(postDate.getDate() - 1)
currentDate.setHours(0, 0, 0)
currentDate.setMilliseconds(0)
currentDate.setMinutes(-(data.offset))
@tharna
tharna / notecat.py
Created January 15, 2019 06:09
Script to categorize notes
#!/usr/bin/python3
from sklearn.feature_extraction.text import TfidfVectorizer
from sklearn.decomposition import NMF
import numpy as np
import csv
documents = open("offering.csv")
tfidf_vectorizer = TfidfVectorizer(max_df=0.50, min_df=2, stop_words='english', max_features=1000)

Keybase proof

I hereby claim:

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

To claim this, I am signing this object:

@tharna
tharna / today
Last active December 19, 2015 23:59
#!/usr/bin/env zsh
function get_user { git config user.email }
user=$(get_user)
since="1 day ago"
total=0
today="today"
onlytotal=0
while getopts "tu:s:" option
do