Skip to content

Instantly share code, notes, and snippets.

View flyfire's full-sized avatar
🎯
Focusing

flyfire flyfire

🎯
Focusing
View GitHub Profile
@flyfire
flyfire / shadowsocks.sh
Created August 2, 2019 14:38 — forked from Jacksgong/shadowsocks.sh
backpu teddysun ss installation script
#!/usr/bin/env bash
PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin
export PATH
#=================================================================#
# System Required: CentOS 6+, Debian 7+, Ubuntu 12+ #
# Description: One click Install Shadowsocks-Python server #
# Author: Teddysun <[email protected]> #
# Thanks: @clowwindy <https://twitter.com/clowwindy> #
# Intro: https://teddysun.com/342.html #
#=================================================================#
@flyfire
flyfire / UKVISA.md
Created April 3, 2019 06:05 — forked from TyrealGray/UKVISA.md
2018 年底离岸申请英国 T2 签证避坑指南

首先可以参考一篇知乎2016年底的文章

https://zhuanlan.zhihu.com/p/24537759

这篇文章列出了比较完备的信息,但是楼主发现有一些重要的东西还是和其他类似文章一样没有点到 (也可能是过时了而最新的签证申请变了吧)

T2工签申请人材料准备

官方目前要求只需要offer letter,存款证明,护照,TB测试结果,雅思UKVI成绩单 (如果是英国认可的英语授课学历可以不需要雅思证明,这个具体怎么操作的楼主不太清楚),在线申请的时候会填基本信息(以及最重要的CoS号码)然后缴费(用支付宝就好,信用卡也行)。缴费后只需要打印checklist的那份表格就行了,然后带上它和材料一并去签证中心即可。

PBS Dependant陪工签申请人

官方要求更简单,只需要A marriage certificate, or a reasonable equivalent, for XXX and XXX,护照,存款证明,TB测试结果即可。在线申请填完表格付款后打印checklist一并带着前往签证中心即可。

@flyfire
flyfire / AttachClient.java
Created March 19, 2019 06:25 — forked from SubOptimal/AttachClient.java
Java attach API - attach to JVM of different user
import com.sun.tools.attach.VirtualMachine;
public class AttachClient {
public static void main(String[] args) throws Exception {
String pid = args[0];
VirtualMachine vm = VirtualMachine.attach(pid);
System.out.println("vm = " + vm);
vm.detach();
}
@flyfire
flyfire / GitConfigHttpProxy.md
Created March 7, 2019 12:18 — forked from evantoli/GitConfigHttpProxy.md
Configure Git to use a proxy

Configure Git to use a proxy

##In Brief

You may need to configure a proxy server if you're having trouble cloning or fetching from a remote repository or getting an error like unable to access '...' Couldn't resolve host '...'.

Consider something like:

@flyfire
flyfire / brew_symlink_error_sierra.md
Created March 2, 2019 01:08 — forked from dalegaspi/brew_symlink_error_sierra.md
Homebrew Symlink errors in Mac OSX High Sierra
@flyfire
flyfire / SnappyRecyclerView.java
Created February 20, 2019 03:53 — forked from nesquena/SnappyRecyclerView.java
Snap-to-Center RecyclerView Extension
// From: http://stackoverflow.com/a/37816976
public class SnappyRecyclerView extends RecyclerView {
// Use it with a horizontal LinearLayoutManager
// Based on http://stackoverflow.com/a/29171652/4034572
public SnappyRecyclerView(Context context) {
super(context);
}
@flyfire
flyfire / Contact.java
Created February 20, 2019 03:37 — forked from rogerhu/Contact.java
Endless scrolling with RecyclerVIew
package codepath.com.recyclerviewfun;
import java.util.ArrayList;
import java.util.List;
public class Contact {
private String mName;
private boolean mOnline;
public Contact(String name, boolean online) {
@flyfire
flyfire / script.sh
Created January 31, 2019 09:11 — forked from dlew/script.sh
Simple AndroidX Migration Script
#!/usr/bin/env bash
# I've found that the "Migrate to AndroidX" converter in Android Studio doesn't work very
# well, so I wrote my own script to do the simple job of converting package names.
#
# You can download a CSV of package names here: https://developer.android.com/topic/libraries/support-library/downloads/androidx-class-mapping.csv
#
# It'll run faster on a clean build because then there are fewer files to scan over.
#
# Uses `gsed` because I'm on a Mac. Can easily replace with `sed` if you don't have `gsed`.
import com.squareup.okhttp.OkHttpClient;
import java.security.cert.CertificateException;
import javax.net.ssl.HostnameVerifier;
import javax.net.ssl.SSLContext;
import javax.net.ssl.SSLSession;
import javax.net.ssl.SSLSocketFactory;
import javax.net.ssl.TrustManager;
import javax.net.ssl.X509TrustManager;
public class OkHttpUtils {
/*
* Copyright (C) 2006 The Android Open Source Project
*
* Licensed 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
*
* Unless required by applicable law or agreed to in writing, software