Skip to content

Instantly share code, notes, and snippets.

View lecion's full-sized avatar
🤡
Coding.

lecion lecion

🤡
Coding.
  • CQUPT
  • CQUPT
View GitHub Profile
@lecion
lecion / powerlevel9k-zsh-config
Created June 13, 2018 16:33
powerlevel9k-zsh-config
POWERLEVEL9K_MODE='nerdfont-complete'
POWERLEVEL9K_LEFT_PROMPT_ELEMENTS=(os_icon dir vcs)
POWERLEVEL9K_RIGHT_PROMPT_ELEMENTS=(status root_indicator time)
POWERLEVEL9K_OS_ICON_BACKGROUND="white"
POWERLEVEL9K_OS_ICON_FOREGROUND="blue"
POWERLEVEL9K_DIR_HOME_FOREGROUND="white"
POWERLEVEL9K_DIR_HOME_SUBFOLDER_FOREGROUND="white"
POWERLEVEL9K_DIR_DEFAULT_FOREGROUND="white"
POWERLEVEL9K_PROMPT_ON_NEWLINE=true
POWERLEVEL9K_PROMPT_ADD_NEWLINE=true
@lecion
lecion / CubicBezier.cpp
Created May 28, 2018 13:17
Cubic-bezier implementation.
float bezier(float t, float p0_x, float p0_y, float p1_x, float p1_y, float p2_x, float p2_y,
float p3_x, float p3_y) {
float c_x = 3 * (p1_x - p0_x);
float b_x = 3 * (p2_x - p1_x) - c_x;
float a_x = p3_x - p0_x - c_x - b_x;
float c_y = 3 * (p1_y - p0_y);
float b_y = 3 * (p2_y - p1_y) - c_y;
float a_y = p3_y - p0_y - c_y - b_y;
@lecion
lecion / build_x264_for_android.sh
Created May 26, 2018 12:46
The build script of X264 for Android. Use NDK lower than r13b.
#!/bin/bash
ADDI_CFLAGS="-marm"
API=16
PLATFORM=arm-linux-androideabi
CPU=armv7-a
NDK=/Users/lecion/Dev/Android/android-ndk-r13b
SYSROOT=$NDK/platforms/android-$API/arch-arm/
ISYSROOT=$NDK/sysroot
ASM=$ISYSROOT/usr/include/$PLATFORM
TOOLCHAIN=$NDK/toolchains/$PLATFORM-4.9/prebuilt/darwin-x86_64
@lecion
lecion / build_for_android.sh
Last active May 27, 2018 08:43
The build script of FFmpeg for Android
#!/bin/bash
ADDI_CFLAGS="-marm"
ADDI_LDFLAGS=""
API=18
PLATFORM=arm-linux-androideabi
CPU=armv7-a
NDK=/Users/lecion/Dev/Android/android-ndk-r13b
SYSROOT=$NDK/platforms/android-$API/arch-arm/
ISYSROOT=$NDK/sysroot
ASM=$ISYSROOT/usr/include/$PLATFORM
@lecion
lecion / configuration.sh
Last active May 26, 2018 11:24
The configuration of FFmpeg for Android
# SLIBNAME_WITH_VERSION='$(SLIBNAME).$(LIBVERSION)'
# SLIBNAME_WITH_MAJOR='$(SLIBNAME).$(LIBMAJOR)'
# LIB_INSTALL_EXTRA_CMD='$$(RANLIB) "$(LIBDIR)/$(LIBNAME)"'
# SLIB_INSTALL_NAME='$(SLIBNAME_WITH_VERSION)'
# SLIB_INSTALL_LINKS='$(SLIBNAME_WITH_MAJOR) $(SLIBNAME)'
SLIBNAME_WITH_VERSION='$(SLIBNAME).$(LIBVERSION)'
SLIBNAME_WITH_MAJOR='$(SLIBPREF)$(FULLNAME)-$(LIBMAJOR)$(SLIBSUF)'
LIB_INSTALL_EXTRA_CMD='$$(RANLIB)"$(LIBDIR)/$(LIBNAME)"'
SLIB_INSTALL_NAME='$(SLIBNAME_WITH_MAJOR)'
SLIB_INSTALL_LINKS='$(SLIBNAME)'
@lecion
lecion / karabiner.json
Last active February 18, 2019 06:24
My config for Karabiner-Elements
{
"global": {
"check_for_updates_on_startup": true,
"show_in_menu_bar": true,
"show_profile_name_in_menu_bar": false
},
"profiles": [
{
"complex_modifications": {
"parameters": {
@lecion
lecion / bintray-gradle-config
Created November 20, 2015 02:47
gradle上传bintray配置参考
apply plugin: 'com.android.library'
apply plugin: 'com.github.dcendents.android-maven'
apply plugin: 'com.jfrog.bintray'
version = "0.1.1"
android {
compileSdkVersion 23
buildToolsVersion "23.0.0"
<?xml version="1.0" encoding="utf-8"?>
<resources>
<!-- google's material design colours from
http://www.google.com/design/spec/style/color.html#color-ui-color-palette -->
<!--reds-->
<color name="md_red_50">#FFEBEE</color>
<color name="md_red_100">#FFCDD2</color>
<color name="md_red_200">#EF9A9A</color>
@lecion
lecion / private.xml
Created September 21, 2015 03:31
Karabiner常用配置文件for Leopold FC660M & FC750R,以及定制CapsLock为Hyper
<?xml version="1.0"?>
<root>
<devicevendordef>
<vendorname>LEOPOLD_66</vendorname>
<vendorid>0x04d9</vendorid>
</devicevendordef>
<deviceproductdef>
<productname>LEOPOLD_FC660M</productname>
<productid>0xa097</productid>
@lecion
lecion / L.java
Created May 26, 2015 06:35
常用工具包
package com.yliec.lbs.util;
import android.app.Activity;
import android.app.Service;
import android.content.Context;
import android.content.Intent;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.Point;
import android.graphics.Rect;