Skip to content

Instantly share code, notes, and snippets.

@perqin
perqin / MainActivity.kt
Created Aug 25, 2018
Activity scene transition not working when starting an existing singleTask Activity in Android
View MainActivity.kt
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 Sep 12, 2017
Android components callbacks' running thread
View AndroidManifest.xml
<?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 Oct 1, 2016
Test cases for NFA
View test0
5 3
{1,3} {} {}
{} {2} {}
{} {2} {}
{} {} {4}
{} {} {4}
2 4 -1
aaaaa
bbb
a
@perqin
perqin / kkk.l
Last active Jun 10, 2016
This is gist description
@perqin
perqin / OSC_Lab04_Task1.cpp
Created May 22, 2016 — forked from anonymous/OSC_Lab04_Task1.cpp
Operating System Concepts course Lab 4 Task 1 source
View OSC_Lab04_Task1.cpp
#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 Aug 6, 2016
sslocal init.d script
View sslocal
#! /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
You can’t perform that action at this time.