Skip to content

Instantly share code, notes, and snippets.

@perqin
perqin / gist:8f2bdba80b2793b96832a0d668100611
Created January 26, 2022 07:00
Linus "deleted" Linux :P
https://github.com/torvalds/linux/tree/8bcab0346d4fcf21b97046eb44db8cf37ddd6da0
@perqin
perqin / script.sh
Created April 18, 2020 06:18
Overrides the captive portal settings of Android devices (All version).
# Aggregated from the internet.
# adb is required.
# You can replace the url with any valid one. This gist use miui.com's.
# You may need to reconnect the network to apply the change.
# Android 7.1.1-10.0
# Source: https://www.noisyfox.io/android-captive-portal.html
# Source: https://hky.moe/archives/162/
adb shell settings put global captive_portal_http_url http://connect.rom.miui.com/generate_204
adb shell settings put global captive_portal_https_url https://connect.rom.miui.com/generate_204
@perqin
perqin / MainActivity.kt
Created August 25, 2018 11:38
Activity scene transition not working when starting an existing singleTask Activity in Android
class MainActivity : BaseActivity() {
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
setContentView(R.layout.activity_main)
with(window) {
enterTransition = Fade().setStartDelay(1000).setDuration(2000).withLogListener("Main.enter")
exitTransition = Fade().setDuration(2000).withLogListener("Main.exit")
returnTransition = Fade().setDuration(2000).withLogListener("Main.return")
reenterTransition = Fade().setStartDelay(1000).setDuration(2000).withLogListener("Main.reenter")
@perqin
perqin / AndroidManifest.xml
Created September 12, 2017 01:33
Android components callbacks' running thread
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.perqin.myapplication">
<application
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
@perqin
perqin / test0
Last active October 1, 2016 09:45
Test cases for NFA
5 3
{1,3} {} {}
{} {2} {}
{} {2} {}
{} {} {4}
{} {} {4}
2 4 -1
aaaaa
bbb
a
@perqin
perqin / kkk.l
Last active June 10, 2016 16:15
This is gist description
lll
@perqin
perqin / OSC_Lab04_Task1.cpp
Created May 22, 2016 12:49 — forked from anonymous/OSC_Lab04_Task1.cpp
Operating System Concepts course Lab 4 Task 1 source
#include <pthread.h>
#include <iostream>
#include <unistd.h>
#include <semaphore.h>
#include <stdlib.h>
#define BUFFER_SIZE 5
#define MAX_SLEEP_TIME 15
typedef int buffer_item;
@perqin
perqin / sslocal
Last active August 6, 2016 14:46
sslocal init.d script
#! /bin/sh
# Works on Ubuntu 16.04.1 LTS
DESC="start sslocal service"
NAME=sslocal
OWNER=shadowsocks
DAEMON=/usr/local/bin/$NAME
PIDFILE=/var/run/$NAME.pid
CONFIGFILE=/etc/$OWNER/$NAME.json