Skip to content

Instantly share code, notes, and snippets.

View Contextualist's full-sized avatar

Contextualist

  • Canton, CN
  • 17:52 (UTC -07:00)
View GitHub Profile
@Contextualist
Contextualist / codeserver-quickstart.md
Created March 28, 2023 22:02
Code Server Quickstart

The project involved is under active development. Refer to their docs for any update.

Run VS Code on a supercomputer's node and access it locally in a browser, so that you (and your VS Code plugins) have universal access to files on the supercomputer and a uniform IDE experience.

Installation and set up

On any supercomputer, run:

curl -fsSL https://code-server.dev/install.sh | sh -s -- --method standalone
from grain.delayed import delayed, each, run
from grain.util import QueueLimiter
from grain.resource import Node
import trio
from pathlib import Path
from functools import partial
@delayed
async def execjob(cmd):
@Contextualist
Contextualist / head.py
Created June 17, 2020 15:46
Grain head alpha (trio, nng)
import trio
from pynng import Pair0
import dill as pickle
from copy import deepcopy
from .util import timeblock
class GrainRemote(object):
def __init__(self, addr, res):
@Contextualist
Contextualist / README.md
Last active June 8, 2020 02:56
Brief guild to get started with sphinx and readthedocs.io

You are in the right place if you...

  1. Want to write documents and docstrings for a Python module and turn them into a presentable form.
  2. Build and host your doc on readthedocs.io (if you don't mind open source your code on github.com) ...
    Or build and host your doc on your own.

Project structure

This is a recommended way to organize your code (e.g. if you have a module named my_mod)

@Contextualist
Contextualist / grain_entrypoint.py
Last active April 11, 2020 20:30
rate-limited top level loop
async def main():
MAXRANK = # MAXRANK
XYZF = # XYZ FILE
with open(XYZF) as f:
# See `ratelimit_nursery.py` below
async with open_nursery_with_capacity(150) as _n: # <<< NOTE: adjust number of pending frame here.
# The number should be as low as possible while being
# high enough to saturate your workers' load.
frange = # THE SET OF FRAME NUMBER TO BE CALCULATED
for i in range(1, max(frange)+1):
@Contextualist
Contextualist / Makefile
Created December 22, 2019 03:05
especial files for the Chuvash SpaCy model
.PHONY: init tokenize frequency word cluster wordvec spacy_init clean
init:
git clone https://github.com/howl-anderson/spacy-dev-resources
conda install SpaCy Gensim ftfy
git clone https://github.com/percyliang/brown-cluster
cd brown-cluster && make
SPACY := $(shell python -c "import spacy; print(spacy.__path__[0])")
hugo
cd public
git add .
git commit -m $1
git push origin master
cd ..
echo "Please git add & git push your change to the content."
@Contextualist
Contextualist / .fusumarc.yml
Created May 12, 2019 16:03
Webpack fails silently
meta:
url:
name:
author:
thumbnail:
description:
sns:
slide:
loop: false
sidebar: true