Skip to content

Instantly share code, notes, and snippets.

View rin2401's full-sized avatar
🏠
Working from home

rin2401 rin2401

🏠
Working from home
View GitHub Profile
@schaunwheeler
schaunwheeler / pyspark_minhash_jaccard.py
Last active September 18, 2024 11:49
Use MinHash to get Jaccard Similarity in Pyspark
from numpy.random import RandomState
import pyspark.sql.functions as f
from pyspark import StorageLevel
def hashmin_jaccard_spark(
sdf, node_col, edge_basis_col, suffixes=('A', 'B'),
n_draws=100, storage_level=None, seed=42, verbose=False):
"""
Calculate a sparse Jaccard similarity matrix using MinHash.
msys2 vs msys vs msysgit
MinGW doesn't provide a linux-like environment, that is MSYS(2) and/or Cygwin
Cygwin is an attempt to create a complete UNIX/POSIX environment on Windows.
MinGW is a C/C++ compiler suite which allows you to create Windows executables - you only
need the normal MSVC runtimes, which are part of any normal Microsoft Windows installation.
MinGW provides headers and libraries so that GCC (a compiler suite,
not just a "unix/linux compiler") can be built and used against the Windows C runtime.
@monokaijs
monokaijs / scanComments_of_IDs.js
Created December 25, 2018 14:53
Scan comments of a list of Facebook IDs
(() => {
/*
{
author: 'MonokaiJs',
facebook: 'https://fb.me/MonokaiJsp',
homepage: 'https://omfg.vn'
// Please DO NOT REMOVE CREDITS IN THIS FILE.
}
*/
@jiewpeng
jiewpeng / add_anaconda_right_click_menu.md
Last active March 1, 2025 12:14
Add Anaconda Prompt to Windows right click context menu

This gist describes how to add Anaconda Prompt to the Windows right click context menu. This is because at some point, Anaconda no longer adds itself to the PATH after installation.

  1. Run regedit.exe
  2. Navigate to HKEY_CLASSES_ROOT > Directory > Background > shell
  3. Add a key named AnacondaPrompt and set its value to "Anaconda Prompt Here" (or anything you'd like it to appear as in the right click context menu)
  4. Add a key under this key, called command, and set its value to cmd.exe /K C:\Anaconda3\Scripts\activate.bat (may have to change the activate.bat file to whereever Anaconda is installed)
@hieuthi
hieuthi / common-vietnamese-syllables.txt
Last active April 2, 2025 16:13
7184 common Vietnamese syllables that's cover more than 94% occurrences, the list is sorted by frequency in descending order. More information can be found at: http://www.hieuthi.com/blog/2017/04/03/vietnamese-syllables-usage.html
của
các
được
trong
cho
không
người
@bgromov
bgromov / git-reset-author.sh
Created June 23, 2016 17:50
Git: reset author for ALL commits
#!/bin/sh
# Credits: http://stackoverflow.com/a/750191
git filter-branch -f --env-filter "
GIT_AUTHOR_NAME='Newname'
GIT_AUTHOR_EMAIL='new@email'
GIT_COMMITTER_NAME='Newname'
GIT_COMMITTER_EMAIL='new@email'
" HEAD