Skip to content

Instantly share code, notes, and snippets.

function cosinesim(A,B){
var dotproduct=0;
var mA=0;
var mB=0;
for(i = 0; i < A.length; i++){
dotproduct += (A[i] * B[i]);
mA += (A[i]*A[i]);
mB += (B[i]*B[i]);
}
mA = Math.sqrt(mA);
{"version":2,"files":[{"path":"C:\\src\\flutter\\packages\\flutter\\lib\\src\\widgets\\automatic_keep_alive.dart","hash":"8a367057f547cab2b20f69bf32c3476a"},{"path":"C:\\src\\flutter\\packages\\flutter\\lib\\src\\widgets\\list_wheel_scroll_view.dart","hash":"194eb26068f6fc7261ce106b30cbc929"},{"path":"C:\\src\\flutter\\packages\\flutter\\lib\\src\\widgets\\performance_overlay.dart","hash":"1c6eeea058f83554c9f68e9feeb520ab"},{"path":"C:\\Users\\Asus\\AndroidStudioProjects\\todoey_flutter\\build\\app\\intermediates\\flutter\\debug\\flutter_assets\\LICENSE","hash":"0000d255865246c9b55862d96ffd3089"},{"path":"C:\\src\\flutter\\.pub-cache\\hosted\\pub.dartlang.org\\collection-1.14.12\\lib\\src\\empty_unmodifiable_set.dart","hash":"736c26e074b754fad400b4f10fa7700a"},{"path":"C:\\src\\flutter\\packages\\flutter\\lib\\src\\gestures\\events.dart","hash":"3f53c158b2501547ae06111ba82e0b8e"},{"path":"C:\\src\\flutter\\.pub-cache\\hosted\\pub.dartlang.org\\vector_math-2.0.8\\lib\\src\\vector_math_64\\opengl.dart","hash":"
@sckott
sckott / check_backup_label.sql
Created July 28, 2020 20:38 — forked from jalexandre0/check_backup_label.sql
SQL to parse and extract information from pg_wal (or pg_xlog) *.backup
SELECT
min(times) AS start_time,
max(times) AS stop_time,
max(times) - min(times) AS duration,
now() - min(times) AS delta_backup_time_from_start,
now() - max(times) AS delta_backup_time_from_finish,
pg_is_in_backup()
FROM
( SELECT
((regexp_matches(pg_read_file(waldir || filename), '[0-9]*-[0-9]*-[0-9]* [0-9]*:[0-9]*:[0-9]*',
@sckott
sckott / new.json
Last active July 28, 2020 17:58 — forked from HugsLibRecordKeeper/output_log.txt
Rimworld output log published using HugsLib
{"package":"zoo","description":{"Package":"zoo","Version":"1.7-11","Depends":"R (>= 2.10.0), stats","Imports":"utils, graphics, grDevices, lattice (>= 0.20-27)","Suggests":"coda, chron, DAAG, fts, its, ggplot2, mondate, scales,\nstrucchange, timeDate, timeSeries, tis, tseries, xts","License":"GPL-2 | GPL-3","NeedsCompilation":"yes"},"snapshotId":"2014-06-17_2300","snapshotDate":"2014-06-17_2300","snapshotDiffId":"19293838-12312323","compatibitlityCheck":{},"source":{"0.1-1":"http://cran.r-project.org/src/contrib/Archive/zoo/zoo_0.1-1.tar.gz","0.1-2":"http://cran.r-project.org/src/contrib/Archive/zoo/zoo_0.1-2.tar.gz","0.1-3":"http://cran.r-project.org/src/contrib/Archive/zoo/zoo_0.1-3.tar.gz","0.1-4":"http://cran.r-project.org/src/contrib/Archive/zoo/zoo_0.1-4.tar.gz","0.2-0":"http://cran.r-project.org/src/contrib/Archive/zoo/zoo_0.2-0.tar.gz","0.9-1":"http://cran.r-project.org/src/contrib/Archive/zoo/zoo_0.9-1.tar.gz","0.9-9":"http://cran.r-project.org/src/contrib/Archive/zoo/zoo_0.9-9.tar.gz","1.0-0":"http:

Keybase proof

I hereby claim:

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

To claim this, I am signing this object:

/*************
* colors.js *
*************
*
* You're almost at the exit. You just need to get past this
* color lock.
*
* Changing your environment is no longer enough. You must
* learn to change yourself. I've sent you a little something
* that should help with that.
@sckott
sckott / clean_species.R
Last active October 5, 2021 14:19 — forked from ibartomeus/clean_species
Cleaning species taxonomy using taxize. I want to correct synonyms and typo's and drop incomplete cases.
# I have >1000 bees to check its name, so I want to automatize taxize for
# fixing misspellings when possible
# updating synonims to accepted names
# keeping ONLY accepted species (full resolved)
# As taxize has many functions I may be not being ptimal, commenets wellcomed.
# If you only want to use the function skip to the end,
# where I placed a wrap up function.
#example: good, synomin, typo, unexisting, genus only.
species <- c("Osmia rufa", "Osmia bicornis", "Osmia ruffa",
@sckott
sckott / body.R
Last active March 1, 2016 19:25 — forked from jeroen/body.R
Post data with GET
library(curl)
h <- new_handle()
handle_setform(h, limit = "3")
handle_setopt(h, customrequest = "POST")
handle_setheaders(h,
"X-HTTP-Method-Override" = "GET"
)
req <- curl_fetch_memory("http://data.techno-science.ca/api/3/action/package_list", handle = h)
jsonlite::fromJSON(rawToChar(req$content))$result
#!/bin/sh
git filter-branch --env-filter '
OLD_EMAIL="your-old-email@example.com"
CORRECT_NAME="Your Correct Name"
CORRECT_EMAIL="your-correct-email@example.com"
if [ "$GIT_COMMITTER_EMAIL" = "$OLD_EMAIL" ]
then
library(dplyr); library(httr); library(rvest)
addr <- "Big Ben"
GET("http://maps.google.com/maps/api/geocode/xml",
query = list(address = addr)) %>%
content() %>%
html_nodes(xpath = "//location//lat | //location//lng") %>%
html_text() %>%
setNames(c("lng", "lat"))