Skip to content

Instantly share code, notes, and snippets.

View dvanic's full-sized avatar

Darya Vanichkina dvanic

View GitHub Profile
@dvanic
dvanic / trello.md
Created August 3, 2021 04:36 — forked from jeremyzilar/trello.md
Copy Trello Board as text or markdown

Copy Trello Board as text or markdown

Wouldn't it be nice to copy out your Trello board as plain text or markdown to be able to put it in a weekly memo, shipping notice or release notes? Now you can!

How to use this

Copy this line of JS and paste it into the CONSOLE in your browser. The results will be saved to your clipboard.

Option 1: Copy your Trello Board as Markdown

This will copy your columns + cards as markdown right to left

var s = []; s.push("# " + jQuery(".board-header").children()[0].innerText); jQuery.fn.reverse = [].reverse; jQuery(".list:has(.list-header-name)").reverse().each(function() {s.push("\n## " + jQuery(this).find(".list-header-name-assist")[0].innerText + "\n"); jQuery(this).find(".list-card-title").each(function() {s.push("* " + this.innerText); }); }); copy(s.join("\n"));
#' ---
#' title: "Summary tables in R"
#' subtitle: "The many ways to making sense of your data"
#' author: "Darya Vanichkina"
#' date: "`r lubridate::today()`"
#' output:
#' xaringan::moon_reader:
#' css: ["default", "assets/sydney-fonts.css", "assets/sydney.css"]
#' self_contained: false # if true, fonts will be stored locally
#' seal: false # show a title slide with YAML information
@dvanic
dvanic / pythonGetObjectMethod.py
Created October 15, 2019 04:11
pythonGetObjectMethod
def get_methods(object, spacing=20):
methodList = []
for method_name in dir(object):
try:
if callable(getattr(object, method_name)):
methodList.append(str(method_name))
except:
methodList.append(str(method_name))
processFunc = (lambda s: ' '.join(s.split())) or (lambda s: s)
for method in methodList:
@dvanic
dvanic / RtabulateNAsbyColumn
Created October 1, 2019 08:10
Tabulate NAs by column in R using dplyr
transaction1 %>%
select_if(function(x) any(is.na(x))) %>%
summarise_each(~sum(is.na(.))) %>%
t()
# https://stackoverflow.com/questions/158044/how-to-use-find-to-search-for-files-created-on-a-specific-date
# files created on June 7th
find . -type f -newermt 2007-06-07 ! -newermt 2007-06-08
# This is the file for the challenges
# 01 Raster structure --------
## Challenge 1
# Challenge: What units are our data in?
#
#
## Challenge 2
# Challenge: Use the output from the GDALinfo() function to find out what NoDataValue is used for our DSM_HARV dataset.
#
#
for (object in characterlistofobjectnames) {
if (exists(object) == FALSE) {
stop(paste0(paste0("The object ", object), " does not exist! Please edit your input list before continuing."))
}
}
@dvanic
dvanic / char2var.R
Last active September 20, 2016 04:12
Character to variable and variable to character conversion #R
# Variable name to character
deparse(substitute(variable))
"variable"
# Character to variable
eval(as.name("variable"))
@dvanic
dvanic / AwkOneLiners.sh
Last active August 20, 2016 08:29
OneLinersFromMyArchiveawk
# http://www.student.northpark.edu/pemente/awk/awk1line.txt
# FILE SPACING:
# double space a file
awk '1;{print ""}'
awk 'BEGIN{ORS="\n\n"};1'
# double space a file which already has blank lines in it. Output file
# should contain no more than one blank line between lines of text.
@dvanic
dvanic / AwkOneLiners.sh
Created August 20, 2016 08:28
OneLinersFromMyArchiveawk
# http://www.student.northpark.edu/pemente/awk/awk1line.txt
# FILE SPACING:
# double space a file
awk '1;{print ""}'
awk 'BEGIN{ORS="\n\n"};1'
# double space a file which already has blank lines in it. Output file
# should contain no more than one blank line between lines of text.