Skip to content

Instantly share code, notes, and snippets.

### Keybase proof
I hereby claim:
* I am alabama on github.
* I am kandakov (https://keybase.io/kandakov) on keybase.
* I have a public key ASBr-TALrXb--6zan3Vt9AfsrTGG6TimzAK-lFA2jhJnrgo
To claim this, I am signing this object:
# we can improve top keywords, if we cache (write into keyword table) the count of the messages
def top_theme_suggestion_keywords(project_id, filters) do
similar_keyword_preloader = fn keyword_ids ->
# gets all grouped keywords from the given keyword_ids which have a cosine_similarity > 0.3
# returns a list with the id in keywords_ids and the id of the grouped keyword as well as the vector_norm of that
# eg:
# id1, id45, [vector_of_45]
# id1, id84, [vector_of_84]
# id1, id32, [vector_of_32]
# id2, id33, [vector_of_33]
@alabama
alabama / able_before_7.php
Last active March 20, 2018 10:54
PHP array values for specific type
// for simple type checks: the given array should only have string values
$aTypes = array_map( "gettype", $aArray ); //we fill an type array with all types we find in the content array
$aTypes = array_unique( $aTypes ); // we unique the found types
return count( $aTypes ) === 1 && $aTypes[0] === "string";