Skip to content

Instantly share code, notes, and snippets.

@gdemin
gdemin / txt-to-google-keep-notes.py
Created December 14, 2019 20:21 — forked from sliceofbytes/txt-to-google-keep-notes.py
Add Text Files as Google Keep Notes
#Import a directory of text files as google keep notes.
#Text Filename is used for the title of the note.
import gkeepapi, os
username = 'username@gmail.com'
password = 'your app password'
keep = gkeepapi.Keep()
success = keep.login(username,password)
@gdemin
gdemin / abs_curr.R
Created May 13, 2019 19:37
Absolute currency exchange rate
currs <- c(
'usd',
'eur',
'chf',
'gbp',
'cad'
)
pairs <- c(
'eurusd',
@gdemin
gdemin / History|-123578ed|entries.json
Last active November 7, 2023 15:46
Visual Studio Code Settings Sync Gist
{"version":1,"resource":"file:///home/gregory/%D0%94%D0%BE%D0%BA%D1%83%D0%BC%D0%B5%D0%BD%D1%82%D1%8B/memo/book_carrol_rider_bullet_journal.md","entries":[{"id":"jsW2.md","timestamp":1651007939623},{"id":"0SrO.md","timestamp":1651007949703},{"id":"zfAe.md","source":"undoRedo.source","timestamp":1651007960527},{"id":"0PUf.md","timestamp":1651008292696},{"id":"G6nS.md","timestamp":1651008307228},{"id":"8uVV.md","source":"undoRedo.source","timestamp":1651008325717},{"id":"IjQh.md","source":"searchReplace.source","timestamp":1651011138472}]}
comments_and_post$rang_posta = rep(NA, length(comments_and_post$post_id))
for (i in 1:length(comments_and_post$post_id)){
if (!is.na(comments_and_post$id[i])) {
comments_and_post$rang_posta[i] <- length(
unique(
comments_and_post$post_id[
comments_and_post1$post_id>comments_and_post1$post_id[i] &
comments_and_post$post_owner_id == comments_and_post$post_owner_id[i] &
comments_and_post$post_date.x < comments_and_post$date[i]
]
@gdemin
gdemin / ConjointExample.R
Created July 28, 2015 19:37
Conjoint example in R with ChoiceModelR
options(stringsAsFactors = FALSE)
library(ChoiceModelR)
library(foreign)
w = read.spss("data.sav",use.value.labels = FALSE, to.data.frame = TRUE)
colnames(w) = tolower(colnames(w))
# token - unique id
# sort by token
if (!anyDuplicated(w$token)) w = w[order(w$token),] else stop("Duplicated ID.")
w1 = subset(w,!is.na(q4_1),select = c(token,s1,q4_1:q4_9))
@gdemin
gdemin / global.R
Last active August 29, 2015 14:14 — forked from SachaEpskamp/global.R
library("shiny")
library("foreign")