Skip to content

Instantly share code, notes, and snippets.

View Kvieta1990's full-sized avatar

Yuanpeng Zhang Kvieta1990

View GitHub Profile
@Kvieta1990
Kvieta1990 / Preferences.sublime-settings
Created October 9, 2023 15:43
SublimeText Settings on MacOS
{
"added_words":
[
"Sep",
"expt",
"fqnintervals",
"chicollection",
"f90",
"exe",
"cd",
@Kvieta1990
Kvieta1990 / config_files.zip
Created September 11, 2023 15:29
Lua init config for nvim
https://www.dropbox.com/scl/fi/lh5j8z1amxk8bnppe7t6y/nvim.zip?rlkey=r59tazlmf1yzwbwn4xc4wsqrc&dl=0
@Kvieta1990
Kvieta1990 / tmux-session
Created March 20, 2023 04:53
.tmux.conf
# : << EOF
# https://github.com/gpakosz/.tmux
# (‑●‑●)> dual licensed under the WTFPL v2 license and the MIT license,
# without any warranty.
# Copyright 2012— Gregory Pakosz (@gpakosz).
# /!\ do not edit this file
# instead, override settings in ~/.tmux.conf.local, see README.md
# -- general -------------------------------------------------------------------
@Kvieta1990
Kvieta1990 / nginx.conf
Created March 15, 2023 04:06
flask+nginx+https minimal example
user nginx;
worker_processes auto;
error_log /var/log/nginx/error.log;
pid /run/nginx.pid;
include /usr/share/nginx/modules/*.conf;
events {
worker_connections 1024;
}
@Kvieta1990
Kvieta1990 / default
Last active February 15, 2023 17:12
orc-iris nginx config
map $http_upgrade $connection_upgrade {
default upgrade;
'' close;
}
server {
listen 80;
server_name _;
return 301 https://orc-iris.ornl.gov$request_uri;
}
@Kvieta1990
Kvieta1990 / jupyter_kernel_list.md
Created November 14, 2022 02:22 — forked from chronitis/jupyter_kernel_list.md
Updated Jupyter Kernels page

What is a kernel?

The kernel lets you run code in a particular programming language using one of the Jupyter tools, such as the Notebook, Jupyterlab or nteract. Installing additional kernels will let you run code in more languages using your existing jupyter installation.

Technically, the kernel is an application which speaks the Jupyter Messaging Protocol, to receive code input from the frontend and respond with the results.

Which kernels do I have installed?

In the Notebook or JupyterLab, the list of available kernels will be shown when trying to create a new notebook.

@Kvieta1990
Kvieta1990 / code_snippet_for_time_filter.py
Created April 21, 2022 20:57
Saving time filtered workspaces to file with specified meaningful name
output_dir = "."
for i in range(mtd[ws + '_filtered'].getNumberOfEntries()):
time_stamp = i * int(time_interval)
time_stamp = f"{time_stamp}"
file_out = os.path.join(output_dir, str(run) + "_" + time_stamp + ".xye")
wks_to_output = title + str(i + 1)
SaveFocusedXYE(InputWorkspace=wks_to_output,
Filename=file_out)
@Kvieta1990
Kvieta1990 / auto_data_confirm_snippet.py
Created April 1, 2022 16:16
Auto data confirmation in autoreduction routine
# >>>>> Confirm data availability >>>>>>>>>>>>>>>>
directory = os.path.join("/SNS/PG3/", ipts, "shared/autoreduce/reduction_log/")
if os.path.isdir(directory):
all_list = []
failure_list = []
for filename_check in os.listdir(directory):
if ".err" in filename_check:
if os.stat(os.path.join(directory, filename_check)).st_size != 0:
@Kvieta1990
Kvieta1990 / wsl.conf
Created January 12, 2022 18:51
WSL mount Windows drive configuration
# Automatically mount Windows drive when the distribution is launched
[automount]
# Set to true will automount fixed drives (C:/ or D:/) with DrvFs under the root directory set above. Set to false means drives won't be mounted automatically, but need to be mounted manually or with fstab.
enabled = true
# Sets the directory where fixed drives will be automatically mounted. This example changes the mount location, so your C-drive would be /c, rather than the default /mnt/c.
# root = /
# DrvFs-specific options can be specified.
@Kvieta1990
Kvieta1990 / kernel.json
Created January 12, 2022 18:42
Windows 10 JupyterLab server using WSL Ubuntu kernel
{
"argv": [
"C:\\windows\\system32\\wsl.exe",
"-d",
"Ubuntu",
"/home/yuanpeng/anaconda3/envs/py37/bin/python",
"-m",
"ipykernel_launcher",
"-f",
"$(wslpath -a '{connection_file}')"