Skip to content

Instantly share code, notes, and snippets.

View ysmintor's full-sized avatar

YorkYu ysmintor

View GitHub Profile
@ysmintor
ysmintor / proxy.md
Created June 29, 2023 12:49 — forked from yougg/proxy.md
complete ways to set http/socks/ssh proxy environment variables

set http or socks proxy environment variables

# set http proxy
export http_proxy=http://PROXYHOST:PROXYPORT

# set http proxy with user and password
export http_proxy=http://USERNAME:PASSWORD@PROXYHOST:PROXYPORT

# set http proxy with user and password (with special characters)
@ysmintor
ysmintor / mactex-uninstaller.sh
Created April 13, 2021 04:00 — forked from papaeye/mactex-uninstaller.sh
Generate MacTeX uninstall script
#!/bin/bash
# https://tug.org/mactex/uninstalling.html
echo "# Uninstall TeX"
echo "rm -rf /usr/local/texlive"
echo "# Uninstall GUI Applications"
echo "rm -rf /Applications/TeX"
@ysmintor
ysmintor / entropy_pku_summer.ipynb
Last active July 13, 2020 01:57
entropy_summer_school
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@ysmintor
ysmintor / trial.key
Created May 15, 2018 05:11 — forked from huqi/trial.key
Beyond Compare 4 license for Mac
Beyond Compare 4
Licensed to: ASIO Allsoftinone
Quantity: 1 user
Serial number: 1822-9597
License type: Pro Edition for Windows
--- BEGIN LICENSE KEY ---
H1bJTd2SauPv5Garuaq0Ig43uqq5NJOEw94wxdZTpU-pFB9GmyPk677gJ
vC1Ro6sbAvKR4pVwtxdCfuoZDb6hJ5bVQKqlfihJfSYZt-xVrVU27+0Ja
hFbqTmYskatMTgPyjvv99CF2Te8ec+Ys2SPxyZAF0YwOCNOWmsyqN5y9t
@ysmintor
ysmintor / ubuntu_old_apt_update.md
Created February 22, 2018 13:58
Ubuntu 15 legacy apt-update

from the github solution webdevops/Dockerfile#212

RUN sed -i -e 's/archive.ubuntu.com\|security.ubuntu.com/old-releases.ubuntu.com/g' /etc/apt/sources.list
@ysmintor
ysmintor / hosts
Last active December 15, 2021 01:33 — forked from coconut49/hosts
OneNote Hosts For China With Microsoft HongKong CDN
204.79.197.212 onedrive.live.com
204.79.197.212 skyapi.onedrive.live.com
204.79.197.212 d.docs.live.net
204.79.197.212 dm2304files.storage.live.com
204.79.197.212 ocws.officeapps.live.com
40.74.129.10 www.onenote.com
104.210.40.87 nexus.officeapps.live.com
204.79.197.212 ocos-office365-s2s.msedge.net
204.79.197.212 directory.services.live.com
204.79.197.212 docs.live.net
@ysmintor
ysmintor / GridDividerItemDecoration
Created April 14, 2017 07:27
griddivider set divider in grid form modified from simple-item-decoration
package com.meixun.b2b.mall.supplier.adapter.decoration;
import android.graphics.Canvas;
import android.graphics.Rect;
import android.graphics.drawable.Drawable;
import android.support.v7.widget.RecyclerView;
import android.view.View;
/**
* Adds interior dividers to a RecyclerView with a GridLayoutManager.
@ysmintor
ysmintor / AutoVerticalScrollTextView.java
Created April 6, 2017 09:23
自动垂直滚动的TextView
import android.content.Context;
import android.graphics.Camera;
import android.graphics.Matrix;
import android.text.TextUtils;
import android.util.AttributeSet;
import android.view.Gravity;
import android.view.View;
import android.view.ViewGroup;
import android.view.animation.AccelerateInterpolator;
import android.view.animation.Animation;
@ysmintor
ysmintor / DownloadActivity.java
Created March 27, 2017 09:23
Android DownloadManager
package com.androidrecipes.downloader;
import android.app.Activity;
import android.app.DownloadManager;
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.IntentFilter;
import android.content.SharedPreferences;
import android.database.Cursor;
@ysmintor
ysmintor / CountDownTask.java
Last active March 24, 2017 03:45
CountDownTimerTask extends AsyncTask
class CountDownTask extends AsyncTask<Long, Void, Pair<String, String>> {
@Override
protected Pair<String, String> doInBackground(Long... params) {
long millisUntilFinished = params[0];
long day = millisUntilFinished / (24 * 60 * 60 * SECOND_IN_MILLIS);
long hour = (millisUntilFinished / (60 * 60 * SECOND_IN_MILLIS) - day * 24);
long min = ((millisUntilFinished / (60 * SECOND_IN_MILLIS)) - day * 24 * 60 - hour * 60);
long s = (millisUntilFinished / SECOND_IN_MILLIS - day * 24 * 60 * 60 - hour * 60 * 60 - min * 60);
String timeLeft = "" + day + "天" + hour + "小时" + min + "分" + s + "秒";
String dayLeft = String.format(Locale.CHINA, "请%d天内处理,超时系统将自动同意此次售后。", day + 1);