Skip to content

Instantly share code, notes, and snippets.

View flyfire's full-sized avatar
🎯
Focusing

flyfire flyfire

🎯
Focusing
View GitHub Profile
@Jacksgong
Jacksgong / shadowsocks.sh
Created February 28, 2019 09:35
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 #
#=================================================================#
@TyrealGray
TyrealGray / UKVISA.md
Created December 20, 2018 05:59
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一并带着前往签证中心即可。

@Tamal
Tamal / git-ssh-error-fix.sh
Last active April 8, 2025 08:00
Solution for 'ssh: connect to host github.com port 22: Connection timed out' error
$ git clone [email protected]:xxxxx/xxxx.git my-awesome-proj
Cloning into 'my-awesome-proj'...
ssh: connect to host github.com port 22: Connection timed out
fatal: Could not read from remote repository.
$ # This should also timeout
$ ssh -T [email protected]
ssh: connect to host github.com port 22: Connection timed out
$ # but this might work
-assumenosideeffects class kotlin.jvm.internal.Intrinsics {
static void checkParameterIsNotNull(java.lang.Object, java.lang.String);
static void checkExpressionValueIsNotNull(java.lang.Object, java.lang.String);
static void checkNotNullExpressionValue(java.lang.Object, java.lang.String);
static void checkReturnedValueIsNotNull(java.lang.Object, java.lang.String, java.lang.String);
static void checkReturnedValueIsNotNull(java.lang.Object, java.lang.String);
static void checkFieldIsNotNull(java.lang.Object, java.lang.String, java.lang.String);
static void checkFieldIsNotNull(java.lang.Object, java.lang.String);
static void checkNotNull(java.lang.Object, java.lang.String);
static void checkNotNullParameter(java.lang.Object, java.lang.String);
/*
* Copyright (C) 2018 Square, Inc.
*
* 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
@dlew
dlew / script.sh
Created November 9, 2018 16:36
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`.
@Archeb
Archeb / SMSF.py
Last active November 21, 2020 08:15
SMS Forwarder
import serial
import re
import requests
ser = serial.Serial('/dev/ttyUSB0')
ser.write('AT+CSCS="UCS2"\n')
while 1:
read=ser.readline()
match=re.match(r'\+CMTI: "ME",(\d+)',read)
if(match):
ser.write('AT+CMGR=' + match.group(1) + '\n')
@JoseAlcerreca
JoseAlcerreca / EventObserver.kt
Created April 26, 2018 12:14
An Observer for Events, simplifying the pattern of checking if the Event's content has already been handled.
/**
* An [Observer] for [Event]s, simplifying the pattern of checking if the [Event]'s content has
* already been handled.
*
* [onEventUnhandledContent] is *only* called if the [Event]'s contents has not been handled.
*/
class EventObserver<T>(private val onEventUnhandledContent: (T) -> Unit) : Observer<Event<T>> {
override fun onChanged(event: Event<T>?) {
event?.getContentIfNotHandled()?.let { value ->
onEventUnhandledContent(value)
@keima
keima / HowToUseActivity.kt
Last active March 31, 2024 21:58
LifecycleOwner implemented RecyclerView ViewHolder & Adapter (concept design)
import android.os.Bundle
import android.util.Log
import android.view.ViewGroup
import android.widget.TextView
import androidx.appcompat.app.AppCompatActivity
import androidx.databinding.DataBindingUtil
import androidx.lifecycle.Lifecycle
import androidx.lifecycle.LifecycleObserver
import androidx.lifecycle.OnLifecycleEvent
import app.keima.android.recyclerviewsandbox.databinding.ActivityMainBinding
@BenoitDuffez
BenoitDuffez / mig
Last active October 12, 2023 18:52
Parse migration failed exception (Android Room)
#!/bin/bash
# Clean up on exit
function finish {
rm -f expected found
}
trap finish EXIT
# How to parse JSON
JQ="jq --sort-keys"