Skip to content

Instantly share code, notes, and snippets.

View tiann's full-sized avatar
🎯
Focusing

weishu tiann

🎯
Focusing
View GitHub Profile
@tiann
tiann / Dockerfile.14_04
Created January 20, 2022 05:32
Build AOSP with docker using Ubuntu
FROM ubuntu:14.04
ARG userid
ARG groupid
ARG username
RUN apt-get update && apt-get install -y git-core gnupg flex bison gperf build-essential zip curl zlib1g-dev gcc-multilib g++-multilib libc6-dev-i386 lib32ncurses5-dev x11proto-core-dev libx11-dev lib32z-dev ccache libgl1-mesa-dev libxml2-utils xsltproc unzip python openjdk-7-jdk
RUN curl -o jdk8.tgz https://android.googlesource.com/platform/prebuilts/jdk/jdk8/+archive/master.tar.gz \
&& tar -zxf jdk8.tgz linux-x86 \
&& mv linux-x86 /usr/lib/jvm/java-8-openjdk-amd64 \
@tiann
tiann / openintab
Created June 18, 2021 04:15
Open selected file or directory in new Finder tab instead of window for macOS
#! /bin/bash
# Copyright (c) 2021, weishu
#
# 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
#
@tiann
tiann / Dockerfile
Created July 17, 2019 04:53
Dockerfile to build lnav
From ubuntu:16.04
RUN apt-get update && apt-get install -y git \
autoconf \
automake \
make \
gcc-5 \
g++-5 \
libgpm-dev \
zlib1g-dev \
import com.android.build.api.transform.*
import com.android.build.gradle.internal.pipeline.TransformManager
import org.apache.commons.io.FileUtils
import java.util.jar.JarEntry
import java.util.jar.JarFile
import java.util.jar.JarOutputStream
import java.util.zip.ZipEntry
class JarZipUtil {
@tiann
tiann / SystemPropertiesCompat.java
Created February 23, 2016 08:50
SystemProperties compat class
package com.qihoo360.mobilesafe.smsclean.utils;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
/**
* SystemProperties 兼容类
* 请不要使用隐藏的SystemProperties API
* <p/>
* 这样使得编译变得麻烦, 也没有必要
@tiann
tiann / markdown_keyboard_mapping.xml
Created February 1, 2016 08:00
remapping the key when use markdown
<?xml version="1.0"?>
<root>
<inputsourcedef>
<name>MY_keylayout_zh_Hans</name>
<inputsourceid_prefix>com.apple.inputmethod.SCIM.ITABC</inputsourceid_prefix>
</inputsourcedef>
<item>
<name>markdown</name>
<identifier>private.quick_dotOfEnglish</identifier>
@tiann
tiann / BetterAsyncTask.java
Last active April 3, 2021 13:35
Better AsyncTask: 1. deal AbortPolicy 2. can run in thread 3. run in parallel 4. avoid crash
package com.example.test.app;/*
* Copyright (C) 2008 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
@tiann
tiann / alfred-pinyin.py
Last active April 5, 2024 14:59
make alfred support pinyin search
#! /usr/bin/python
# -*- coding: utf-8 -*-
# @author weishu @2015/12/7
import subprocess
import os
import re
import json
@tiann
tiann / auto_switch_kb.py
Created December 2, 2015 06:51
auto switch keyboard to english in specific applications
#! /usr/bin/env python
# coding: utf-8
'''
auto switch keyboard between different applications
if you want to change the app list, modify the var 'ignore_list'
'''
from AppKit import NSWorkspace, NSWorkspaceDidActivateApplicationNotification, NSWorkspaceApplicationKey