This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.oneclock.server.util | |
import org.apache.commons.codec.binary.Base64 | |
import javax.crypto.SecretKeyFactory | |
import javax.crypto.spec.PBEKeySpec | |
import java.security.NoSuchAlgorithmException | |
import java.security.SecureRandom | |
import java.security.spec.InvalidKeySpecException |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var cntrCodeMap = _.object('0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ'.split(""), _.without(_.range(0, 39), 11, 22, 33)); | |
$.validator.addMethod("cntrNo", function(value, element){ | |
if (!value.match('^[A-Z]{4}[0-9]{7}$')) { | |
return false; | |
} | |
var chars = value.split(""); | |
var checkNo = chars.splice(10, 1); | |
var sum = _.reduce(chars, function(check, char, index){ | |
return check + cntrCodeMap[char] * Math.pow(2, index); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$.fn.serializeObject = function() | |
{ | |
var o = {}; | |
var a = this.serializeArray(); | |
$.each(a, function() { | |
if (o[this.name] !== undefined) { | |
if (!o[this.name].push) { | |
o[this.name] = [o[this.name]]; | |
} | |
o[this.name].push(this.value || ''); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
*.class | |
*.jar | |
*.ear | |
*.war | |
*.iml | |
*.ipr | |
*.iws | |
.classpath | |
.project | |
rebel.xml |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package com.liba.core | |
import org.slf4j.Logger | |
import org.slf4j.LoggerFactory | |
import org.springframework.stereotype.Component | |
import org.springframework.web.filter.OncePerRequestFilter | |
import javax.servlet.FilterChain | |
import javax.servlet.ServletException | |
import javax.servlet.http.HttpServletRequest |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// This hack works with com.android.tools.build:gradle:0.2, won't work in later version without modification | |
apply plugin: 'android' | |
targetCompatibility = 1.6 | |
sourceCompatibility = 1.6 | |
android { | |
target = 'android-14' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Toast toast = Toast.makeText(this, stringRes, Toast.LENGTH_SHORT); | |
toast.setGravity(Gravity.TOP | Gravity.CENTER, 0, 0); | |
toast.show(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8"?> | |
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"3 | |
android:layout_width="fill_parent" | |
android:layout_height="fill_parent" | |
android:background="#FFFFFF" | |
android:gravity="center" | |
android:orientation="horizontal" | |
android:weightSum="1"> | |
<Button |
NewerOlder