Skip to content

Instantly share code, notes, and snippets.

View yftx's full-sized avatar
☺️

yftx.net yftx

☺️
  • SnailGame
  • SuZhou,China
View GitHub Profile
@yftx
yftx / ImagePicker.java
Created January 3, 2017 16:16 — forked from Mariovc/ ImagePicker.java
Utility for picking an image from Gallery/Camera with Android Intents
import android.app.Activity;
import android.content.Context;
import android.content.Intent;
import android.content.pm.ResolveInfo;
import android.content.res.AssetFileDescriptor;
import android.database.Cursor;
import android.graphics.Bitmap;
import android.graphics.BitmapFactory;
import android.graphics.Matrix;
import android.media.ExifInterface;
@yftx
yftx / OkHttp3Stack.java
Created November 4, 2016 03:25 — forked from alashow/OkHttp3Stack.java
An OkHttp backed HttpStack for Volley (okhttp3 version)
/**
* The MIT License (MIT)
*
* Copyright (c) 2015 Circle Internet Financial
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
@yftx
yftx / ss.php
Last active January 14, 2019 09:05
vpn ss连接速度测试
#!/usr/local/opt/php56/bin/php
<?php
/**
* ping ss测试速度,当返回平均值为-1时,表示有丢包情况.
*/
const REG_FLAG = "time=";
const BLANK = "\40";
const PING_TIMES = 3;
$regFlagLength = strlen(REG_FLAG);
@yftx
yftx / countLineNum.py
Created November 26, 2014 11:30
统计代码行数
# -*- coding: utf-8 -*-
#!/usr/bin/python
# linecount.py
# 2009-1-20
# author:
# Jason Lee
# fix:
# yftx : when file has no postfix ,the app crash
#
import sys
@yftx
yftx / ml.lua
Created April 14, 2012 08:18 — forked from stevedonovan/ml.lua
Microlight - a really compact set of general Lua functions
-----------------
-- Microlight - a very compact Lua utilities module
--
-- Steve Donovan, 2012; License MIT
-- @module ml
local ml = {}
--- String utilties.
-- @section string
@yftx
yftx / ml.lua
Created March 31, 2012 16:10 — forked from stevedonovan/ml.lua
Microlight - a really compact set of general Lua functions
-----------------
-- Microlight - a very compact Lua utilities module
--
-- Steve Donovan, 2012; License MIT
-- @module ml
local ml = {}
--- String utilties.
-- @section string