Skip to content

Instantly share code, notes, and snippets.

View DickyChant's full-sized avatar
😀

Sitian Qian DickyChant

😀
View GitHub Profile
@DickyChant
DickyChant / .zshrc_cursor_snippet
Created November 23, 2024 21:22
Cursor helpers
# ... Other .zshrc contents above
function cursor() {
/opt/cursor.appimage --no-sandbox "$@" >/dev/null 2>&1 &
}
# I used the default settings in the cursor install script here
@DickyChant
DickyChant / index.html
Last active March 3, 2022 11:49 — forked from darwin/index.html
Welcome to comix!
<!DOCTYPE html>
<meta charset="utf-8">
<link rel="stylesheet" href="http://cmx.io/v/0.1/cmx.css"/>
<script src="http://cmx.io/v/0.1/cmx.js"></script>
<body>
<div style="max-width:1800px; -webkit-transform:rotate(0deg)">
<scene id="scene1" height="400" width="400">
<label t="translate(0,400)">
<tspan x="0" y="0em">SM Neutrinos are massless</tspan>
@DickyChant
DickyChant / Matplotlib Backends.md
Created December 19, 2021 10:49 — forked from CMCDragonkai/Matplotlib Backends.md
Matplotlib Backends #matplotlib #python

Matplotlib Backends

Matplotlib is a plotting library. It relies on some backend to actually render the plots. The default backend is the agg backend. This backend only renders PNGs. On Jupyter notebooks the matplotlib backends are special as they are rendered to the browser. Generally you will not need to explicitly set the backend on a Jupyter notebook. This does introduce a discrepancy between code that runs in Jupyter and code that runs as a script natively in the Python interpreter. So you need to understand that the 2 environments are not the same

@DickyChant
DickyChant / tmux-cheatsheet.markdown
Created August 16, 2021 17:52 — forked from ryerh/tmux-cheatsheet.markdown
Tmux 快捷键 & 速查表 & 简明教程

注意:本文内容适用于 Tmux 2.3 及以上的版本,但是绝大部分的特性低版本也都适用,鼠标支持、VI 模式、插件管理在低版本可能会与本文不兼容。

Tmux 快捷键 & 速查表 & 简明教程

启动新会话:

tmux [new -s 会话名 -n 窗口名]

恢复会话:

@DickyChant
DickyChant / .tmux.conf
Created August 15, 2021 13:41 — forked from gblmarquez/.tmux.conf
.tmux.conf with fish as default shell
# Default termtype. If the rcfile sets $TERM, that overrides this value.
set -g default-terminal screen-256color
# support logging out and back in
set -g update-environment "SSH_ASKPASS SSH_AUTH_SOCK SSH_AGENT_PID SSH_CONNECTION"
# pbcopy support
set-option -g default-command "reattach-to-user-namespace -l bash"
# vi mode
@DickyChant
DickyChant / crab3_setup
Created May 14, 2021 00:37 — forked from nsahoo/crab3_setup
CRAB3 tutorial
0) You can get the complete tutorial about CRAB3
https://twiki.cern.ch/twiki/bin/view/CMSPublic/WorkBookCRAB3Tutorial (UPDATED TWIKI PAGE)
For impatient users, a cheat-sheet is available
https://twiki.cern.ch/twiki/bin/viewauth/CMS/CRAB3CheatSheet
1) login to lxplus SLC6 machine by doing
ssh -Y [email protected]
2) source LCG GRID UI by
@DickyChant
DickyChant / plotsCfgFromJie
Last active February 8, 2021 13:27
Plots configs from Jie Xiao
import uproot4, uproot
import awkward1 as ak
import numba as nb
from uproot3_methods import TLorentzVectorArray, TLorentzVector
import os
import feather
import numpy as np
import boost_histogram as bh
import matplotlib.pyplot as plt
@DickyChant
DickyChant / config_Herwig7_cff.py
Created January 15, 2021 11:47
The fragments used for using Herwig++ as PS in CMSSW
import FWCore.ParameterSet.Config as cms
externalLHEProducer = cms.EDProducer("ExternalLHEProducer",
args = cms.vstring("/home/stqian/gridpack/herwig_dyellell012j_5f_NLO_FXFX_slc6_amd64_gcc630_CMSSW_9_3_16_tarball.tar.xz"),
nEvents = cms.untracked.uint32(5000),
numberOfParameters = cms.uint32(1),
outputFile = cms.string('cmsgrid_final.lhe'),
scriptName = cms.FileInPath('GeneratorInterface/LHEInterface/data/run_generic_tarball_cvmfs.sh')
)
"""
Helper module for displaying ROOT canvases in ipython notebooks
Usage example:
# Save this file as rootnotes.py to your working directory.
import rootnotes
c1 = rootnotes.default_canvas()
fun1 = TF1( 'fun1', 'abs(sin(x)/x)', 0, 10)
c1.SetGridx()