Skip to content

Instantly share code, notes, and snippets.

View bernatfortet's full-sized avatar

Bernat Fortet bernatfortet

View GitHub Profile
// search returns array of matching docs ranked by tf-idf score
// aka term frequency * inverse document frequency
//
// tf = # of occurences of term in document / # of words in document
// idf = log ( # of documents / # of documents with term )
// tf-idf = tf * idf
// multi-term tf-idf = sum of tf-idf scores (per document)
type Doc = string
import create, { GetFunction, SetFunction } from 'zustand'
export type MyStore = {
flag?: boolean
actions: MyActions
}
class MyActions {
@bernatfortet
bernatfortet / metacheck
Created January 27, 2018 18:08
Website step
- Check meta
http://www.heymeta.com/url/cryptagon.io
Add analytics
export const extra = [
{
title: 'Home Assessment',
description: `First you will fill out an assessment that illuminates what life in the 21st century is for you, your family and home to make sure you understand what is causing the overwhelm and stress in your home life`,
formats: [
`Worksheet`,
`1 hour of my help at your home`,
`1 hour of my help at your home`,
],
},
@bernatfortet
bernatfortet / block
Created December 5, 2017 06:11
Blocsktack 2
Verifying my Blockstack ID is secured with the address 1EtceTigT7sGEk2ZWxgcF1eU8KRcMTJW1c https://explorer.blockstack.org/address/1EtceTigT7sGEk2ZWxgcF1eU8KRcMTJW1c
@bernatfortet
bernatfortet / Blockstack Verification
Last active December 5, 2017 06:11
Blockstack Verification
Verifying my Blockstack ID is secured with the address 1EtceTigT7sGEk2ZWxgcF1eU8KRcMTJW1c https://explorer.blockstack.org/address/1EtceTigT7sGEk2ZWxgcF1eU8KRcMTJW1c
@bernatfortet
bernatfortet / coinMarketCapTop20
Last active August 17, 2017 03:11
Reorganize coinMarketCap Top20 by volume and negative change
javascript:(function(){
tbody = $('#currencies_wrapper').find('tbody');
tbody.children()
.each( function(index, item){
if( index >= 20 )
item.remove();
});
@bernatfortet
bernatfortet / globalNodePacakges.sh
Last active May 23, 2017 22:22
Global packages
sudo npm install -g grunt-cli react-native firebase-tools n
@bernatfortet
bernatfortet / grubMarket.js
Last active May 25, 2017 23:36
Parse grub Market deals
javascript:(function(){
$('.cards__item').each( function( item ){
console.log('item', $(this) );
var disccountStr = $(this).find('.pct-off').text();
var disccount = parseInt( disccountStr.substring(5, disccountStr.length-1) );
if( disccount < 50 ){
$(this).remove();
}
handleKeyDown = () => {
if(event.keyCode == 32)
this.setState({ isSpacebarPressed: true })
}
handleKeyUp = () => {
if(this.state.isSpacebarPressed)
this.setState({ isSpacebarPressed: false })