Skip to content

Instantly share code, notes, and snippets.

View Thesharing's full-sized avatar

Zhilong Hong Thesharing

View GitHub Profile
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
@Thesharing
Thesharing / flink-web.log
Created July 28, 2020 11:27
The log of flink-web after upgrading Jekyll to 4.0.5
@Thesharing
Thesharing / git-rename-stash.sh
Created August 23, 2019 07:40 — forked from jdforsythe/git-rename-stash.sh
Rename Git Stash
#!/bin/bash
git stash list
echo "Enter stash number to rename"
read stash_number
echo "Enter new name"
read new_name
stash_name="stash@{${stash_number}}"
echo "$stash_name"
@Thesharing
Thesharing / pandas_to_csv_chinese_unreadable.md
Created June 22, 2019 07:11
Pandas Dataframe to_csv() 方法中文乱码解决方案

在用pandas.DataFrame.to_csv()方法时,如果使用默认编码或者指定编码为'utf-8'时中文会乱码。

import pandas as pd

df = pd.DataFrame()
df.to_csv(encoding='utf-8')

问题的根源在于文件开头没有BOM。

@Thesharing
Thesharing / update-repos.sh
Created April 11, 2019 14:04
Clone and update all the forked repositories
ORG=Awesome-Interview
curl -s https://api.github.com/orgs/$ORG/repos?per_page=200 | jq .[].clone_url | xargs -n 1 git clone
for REPO in *
do
cd $REPO
curl -s https://api.github.com/repos/$ORG/$REPO | jq .parent.clone_url | xargs -n 1 git remote add upstream
git fetch upstream
git checkout master
@Thesharing
Thesharing / go-get-with-shadowsocks.md
Created March 13, 2019 10:14
在Windows中借助Shadowsocks运行Go Get

在命令提示行中先输入

set HTTP_PROXY=127.0.0.1:1080
set HTTPS_PROXY=127.0.0.1:1080

然后再运行

@Thesharing
Thesharing / thread_pool.py
Created December 5, 2018 19:13 — forked from heavywatal/thread_pool.py
Example of thread pool in Python
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Example of thread pool
https://docs.python.org/3/library/concurrent.futures.html
https://docs.python.org/3/library/multiprocessing.html
"""
import concurrent.futures as confu
import multiprocessing.pool as mpp
import time
@Thesharing
Thesharing / Python with sudo.md
Created September 15, 2018 14:11
Sudo运行Python

sudo env PATH=$PATH python

@Thesharing
Thesharing / CloudMusic-HiDPI.md
Created September 15, 2018 11:31
网易云音乐解决高DPI屏幕中显示模糊的问题

在“网易云音乐”的快捷方式上右击进入快捷方式“属性”选项卡中,在“目标”一栏的末尾添加--force-device-scale-factor=2,其中2为显示缩放比例(200%为2, 175%为1.75,以此类推)

然后进入“兼容性”选项卡,选择“更改高DPI设置”(17134版本),在“替代高DPI缩放行为。缩放执行”处选择“应用程序”,然后“确定”即可。

通过此快捷方式打开的网易云音乐界面缩放正常且不会模糊,但是托盘菜单由于仍然是Qt渲染的,因此字体会变得特别小。

参考:

网易云音乐 windows 版啥时候可以支持 high DPI 啊

@Thesharing
Thesharing / Install CUDA on Ubuntu Server.md
Last active April 25, 2021 16:24
在Ubuntu Server上安装CUDA

本文针对Ubuntu 16.04 LTS版本。

1 准备工作

1.1 检查GPU是否符合CUDA运行要求

在Shell中运行命令:

lspci | grep -i nvidia