Skip to content

Instantly share code, notes, and snippets.

Avatar

Bernat Fortet bernatfortet

View GitHub Profile
View tf-idf.ts
// 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
View storeTEMPLATE.ts
import create, { GetFunction, SetFunction } from 'zustand'
export type MyStore = {
flag?: boolean
actions: MyActions
}
class MyActions {
View metacheck
- Check meta
http://www.heymeta.com/url/cryptagon.io
Add analytics
View gist:121ae44e33178304d6dff0e90222ab79
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`,
],
},
View block
Verifying my Blockstack ID is secured with the address 1EtceTigT7sGEk2ZWxgcF1eU8KRcMTJW1c https://explorer.blockstack.org/address/1EtceTigT7sGEk2ZWxgcF1eU8KRcMTJW1c
@bernatfortet
bernatfortet / Blockstack Verification
Last active Dec 5, 2017
Blockstack Verification
View Blockstack Verification
Verifying my Blockstack ID is secured with the address 1EtceTigT7sGEk2ZWxgcF1eU8KRcMTJW1c https://explorer.blockstack.org/address/1EtceTigT7sGEk2ZWxgcF1eU8KRcMTJW1c
@bernatfortet
bernatfortet / coinMarketCapTop20
Last active Aug 17, 2017
Reorganize coinMarketCap Top20 by volume and negative change
View coinMarketCapTop20
javascript:(function(){
tbody = $('#currencies_wrapper').find('tbody');
tbody.children()
.each( function(index, item){
if( index >= 20 )
item.remove();
});
View globalNodePacakges.sh
sudo npm install -g grunt-cli react-native firebase-tools n
@bernatfortet
bernatfortet / grubMarket.js
Last active May 25, 2017
Parse grub Market deals
View grubMarket.js
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();
}
View addKeyListenerToReactComponent
handleKeyDown = () => {
if(event.keyCode == 32)
this.setState({ isSpacebarPressed: true })
}
handleKeyUp = () => {
if(this.state.isSpacebarPressed)
this.setState({ isSpacebarPressed: false })
You can’t perform that action at this time.