Skip to content

Instantly share code, notes, and snippets.

View genzj's full-sized avatar
👽
你现在最大的问题是做了人类

genzj genzj

👽
你现在最大的问题是做了人类
View GitHub Profile
@genzj
genzj / NerdFont for Code.user.js
Last active June 9, 2023 09:17
Use NerdFont in code/pre tags, such as github
View NerdFont for Code.user.js
// ==UserScript==
// @name NerdFont for Code
// @namespace http://genzj.info/
// @version 0.1
// @description Use NerdFont in code/pre tags, such as github
// @author You
// @match https://github.com/*
// @match https://gist.github.com/*
// @icon https://www.google.com/s2/favicons?sz=64&domain=github.com
// @grant GM_addStyle
@genzj
genzj / to-pytorch-1.7.1.diff
Created December 31, 2020 08:06
Migrate DAIN https://github.com/baowenbo/DAIN to PyTorch 1.7.1 with CUDA 10.2
View to-pytorch-1.7.1.diff
diff --git a/PWCNet/correlation_package_pytorch1_0/correlation.py b/PWCNet/correlation_package_pytorch1_0/correlation.py
index 80a8b09..fe8ab06 100644
--- a/PWCNet/correlation_package_pytorch1_0/correlation.py
+++ b/PWCNet/correlation_package_pytorch1_0/correlation.py
@@ -4,19 +4,16 @@ from torch.autograd import Function
import correlation_cuda
class CorrelationFunction(Function):
-
- def __init__(self, pad_size=3, kernel_size=3, max_displacement=20, stride1=1, stride2=2, corr_multiply=1):
@genzj
genzj / script.py
Created July 22, 2019 05:38
crop and resize images, powered by PIL
View script.py
# -*- encoding: utf-8 -*-
import logging
import os.path
import sys
from PIL import Image
logging.basicConfig(level=logging.INFO)
L = logging.getLogger(__name__)
L.setLevel(logging.INFO)
@genzj
genzj / cloudSettings
Last active March 6, 2020 13:29
Visual Studio Code Settings Sync Gist
View cloudSettings
{"lastUpload":"2020-03-06T13:29:30.156Z","extensionVersion":"v3.4.3"}
@genzj
genzj / dynamic-host.json
Created February 17, 2019 04:58
An example of an ansible dynamic inventory script in Python
View dynamic-host.json
{
"group001": {
"hosts": ["host001", "host002"],
"vars": {
"var1": true
},
"children": ["group002"]
},
"group002": {
"hosts": ["host003","host004"],
@genzj
genzj / example-repo.log
Last active August 31, 2018 11:45
A git remote hook example to iterate and check each commits in a push
View example-repo.log
* commit 9b5a1a68de5df1702f59c7d309e73d7152b5c582 (HEAD -> master, new)
| Author: ZHU Jie <jie.zhu@huangloong.com>
| Date: Fri Aug 31 10:52:57 2018 +0000
|
| update another file
|
* commit 6d94315602e0969e61d7f141cb3f27e567bd65f5
| Author: ZHU Jie <jie.zhu@huangloong.com>
| Date: Fri Aug 31 10:52:42 2018 +0000
|
@genzj
genzj / README.md
Created August 26, 2018 13:05 — forked from DocX/README.md
Connect to bash inside running ECS container by cluster and service name
View README.md
@genzj
genzj / rot-dict.py
Created December 22, 2017 15:37
Rotting substitution cipher examples
View rot-dict.py
# -*- encoding: utf-8 -*-
def circle_alphabet(offset='a', start='a'):
start_code = ord(start)
offset_code = ord(offset)
for i in range(offset_code, start_code + 26):
yield chr(i)
for i in range(start_code, offset_code):
yield chr(i)
@genzj
genzj / env.sh
Created September 2, 2017 06:03
Jupyterhub use OAuth with local user
View env.sh
# env
#
# add your github oauth config to this file
# and launch the server with `sh run.sh`
#
# Note: Be careful to keep the client secret private. Use caution
# with version control to prevent publicly exposing the secret.
export GITHUB_CLIENT_ID=
export GITHUB_CLIENT_SECRET=
export OAUTH_CALLBACK_URL=
@genzj
genzj / issue_token_v3.sh
Created October 24, 2016 06:40
Retrieve an unscoped token from Keystone.
View issue_token_v3.sh
#!/bin/bash
default_domain_name='default'
if [[ $# -lt 2 ]] ; then
echo "Usage: $0 USERNAME PASSWORD"
exit 1
fi
curl -i \
-H "Content-Type: application/json" \
-d '