Skip to content

Instantly share code, notes, and snippets.

@sharontlin
sharontlin / .env
Created February 14, 2023 00:38
rust-server
DATABASE_URL = mongodb://localhost:27017
DATABASE_NAME = db
USER_COLLECTION_NAME = db
SERVER_URL = localhost:4000
@sharontlin
sharontlin / keybase.md
Created March 12, 2020 01:11
keybase.md

Keybase proof

I hereby claim: * I am sharontlin on github. * I am sharonlin (https://keybase.io/sharonlin) on keybase. * I have a public key ASBEsdh_sxAgKZWcau0dz0WnrFD07xG4A6K0JbHuZ0KZ6Qo To claim this, I am signing this object:

{   "body": {     "key": {       "eldest_kid": "0101ba2a10ba474a13939bf5fbfc4e6b875daf682ca623ebffcbc6eded717ca3eb310a",       "host": "keybase.io",       "kid": "012044b1d87fb3102029959c6aed1dcf45a7ac50f4ef11b803a2b425b1ee674299e90a",       "uid": "4f758d43d2e97464da3721685680e819",       "username": "sharonlin"     },     "merkle_root": {       "ctime": 1583975184,       "hash": "99275c31a013c3b0e5f32bfe6efccea05589e6031fa39a084a310f395df4a1ff7b40bc0f3c4660fadb1fc38b2bae3a8321b46eebf9931d5662e8a3ee5b3d9a8d",       "hash_meta": "39471b8a8d6c8246f30588a7727c2bec5d2604cf49e0e8210d41c0b75b1ba75d",       "seqno": 15299472     },     "service": {       "entropy": "WviZS+6X9HPw0/3U3hDNdEQn",       "name": "github",       "username": "sharontlin"     },     "type": "w
@sharontlin
sharontlin / scraper.py
Created January 23, 2020 21:30
GitHub Dependents Scraper
from bs4 import BeautifulSoup
import requests
import csv
outfile = open('projects.csv','a', newline='')
writer = csv.writer(outfile)
page_link='https://github.com/django/django/network/dependents?dependents_after=MTE0NzkwOTIxOTk'
page_response = requests.get(page_link, timeout=5)
page_content = BeautifulSoup(page_response.content, "html.parser")
@sharontlin
sharontlin / LessThan.java
Created January 17, 2020 22:07
Comparing pfff, bblfsh, tree-sitter
class LessThan {
void main(int i, int j) {
return i<j;
}
}
@sharontlin
sharontlin / LambdaFunctions.java
Last active January 17, 2020 01:34
tree-sitter JSON output
public class Foo {
public static void main(String args[]) {
// with type declaration
Operations addition = (int a, int b) -> a + b;
}
interface Operations {
int operation(int a, int b);
}
}
@sharontlin
sharontlin / cassandra.json
Last active January 16, 2020 10:01
Babelfish Java Driver
{ '@type': "java:CompilationUnit",
'@role': [File],
'@pos': { '@type': "uast:Positions",
start: { '@type': "uast:Position",
offset: 0,
line: 1,
col: 1,
},
end: { '@type': "uast:Position",
offset: 13477,