Skip to content

Instantly share code, notes, and snippets.

阿亮同学 aliang228

Block or report user

Report or block aliang228

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@aliang228
aliang228 / ImageCompresser.java
Created Aug 11, 2017
java图片压缩到200K以内
View ImageCompresser.java
import java.awt.image.BufferedImage;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStream;
import java.util.Date;
import java.util.Iterator;
import javax.imageio.IIOImage;
@aliang228
aliang228 / ip.sh
Created Oct 18, 2016
echo ip address
View ip.sh
ifconfig en0 | awk '$1 == "inet" {print $2}'
@aliang228
aliang228 / gorm_model_gen.go
Created Dec 17, 2015
auto generate gorm models
View gorm_model_gen.go
package main
import (
"database/sql"
"fmt"
"os"
"strings"
_ "github.com/go-sql-driver/mysql"
)
@aliang228
aliang228 / MResource.java
Created Jul 14, 2015
Android get res id not by R
View MResource.java
import android.content.Context;
import android.content.res.Resources;
public class MResource {
private static int getResID(Context context, String resName, String defType) {
Resources res = context.getResources();
return res.getIdentifier(resName, defType, context.getPackageName());
}
@aliang228
aliang228 / Test.java
Last active Aug 29, 2015
判断两个字符串是否是回环变位
View Test.java
/**
* Created by a598799539 on 15-7-2.
* github: https://github.com/a598799539
*/
public class Test {
public static void main(String[] args){
String string1 = "ACAT";
String string2 = "TACA";
isCircleRotation(string1,string2);
}
@aliang228
aliang228 / enterSubmit.js
Last active Aug 29, 2015
输入框enter事件触发
View enterSubmit.js
//回车提交
function enterLogin(e){
var e = e || window.event;
if(e.keyCode == 13){
...
}
}
<input type="password" id="password" placeholder="输入密码" onkeypress="enterLogin(event)" onkeydown="enterLogin()"/>
You can’t perform that action at this time.