Skip to content

Instantly share code, notes, and snippets.

View jittagornp's full-sized avatar
🍼

Jittagorn Pitakmetagoon jittagornp

🍼
View GitHub Profile
@jittagornp
jittagornp / hack
Last active August 29, 2015 14:17
kuku hack
var play = '.play-btn';
var el = '#box';
var time = '.time';
function check(){
var map = {};
$(el).children().each(function(){
var color = $(this).css('background-color');
map[color] = map[color] || { score : 0 };
@jittagornp
jittagornp / model.js
Last active August 29, 2015 14:23
angularjs model of pamarin.com
/**
* pamarin © 2015
*/
pamarin.factory('enum.Enumerate', function () {
return (function (list, fnc) {
/**
* @enum Enumerate
*/
@jittagornp
jittagornp / PageData.java
Last active August 29, 2015 14:24
code flow of pamarin api
package com.pamarin.api.model.page;
import com.pamarin.api.model.MetaProperty;
import com.pamarin.api.model.page.impl.PageContent;
import java.util.List;
import org.codehaus.jackson.map.annotate.JsonSerialize;
/**
* @author jittagornp
*/
@jittagornp
jittagornp / app.js
Last active August 29, 2015 14:24
flow control of trip page pamarin.com
pamarin.factory('model.Trip', [
'model.User',
'model.Tag',
'model.Link',
'enum.ArticleStatus',
'model.ProtocolMapper',
function (User, Tag, Link, ArticleStatus, ProtocolMapper) {
/**
* @model Trip
@jittagornp
jittagornp / pamarin.js
Last active October 8, 2015 02:32
angularjs of pamarin.com
/**
* @author jittagornp
* create 22/08/2015
*/
var pamarin = angular.module('pamarin', [
'ui.router',
'ui.router.stateHelper',
'LocalStorageModule',
'ngDialog',
'ab-base64',
@jittagornp
jittagornp / setup-nodejs4cpone.md
Last active August 29, 2015 14:27
setup node.js for project cpone
  1. install node.js download node.js installer (window use .mis) from this url https://nodejs.org/download/

  2. open command line then typed command, for install grunt module

$ npm install -g grunt-cli
@jittagornp
jittagornp / user.java
Last active June 23, 2021 10:00
User.java
package com.pamarin.persistence.entity;
import com.fasterxml.jackson.annotation.JsonAutoDetect;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonInclude.Include;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.pamarin.persistence.converter.JsonDateTimeSerializer;
import com.pamarin.persistence.converter.JsonEnumSerializer;
import com.pamarin.persistence.generator.PrimaryKeyGenerator;
package com.pamarin.api.store;
import com.pamarin.api.util.BufferedImageUtils;
import java.awt.image.BufferedImage;
import java.io.File;
import java.io.IOException;
import java.util.Date;
import javax.imageio.ImageIO;
import net.coobird.thumbnailator.Thumbnails;
import net.coobird.thumbnailator.geometry.Positions;
package com.pamarin.rest.api.exception;
import com.pamarin.api.exception.ApiAuthorizationException;
import com.pamarin.api.exception.AuthorizationException;
import com.pamarin.api.exception.AuthenticationException;
import com.pamarin.api.exception.entity.AlreadyExistTripException;
import com.pamarin.api.exception.entity.InvalidFieldException;
import com.pamarin.api.exception.entity.CommentNotFoundException;
import com.pamarin.api.exception.entity.TripNotFoundException;
import com.pamarin.api.exception.entity.TripPostNotFoundException;
@jittagornp
jittagornp / NumberFormatKeyin.js
Last active November 18, 2015 23:42
ป้องกันการ keyin ที่ไม่ใช่ตัวเลขลง html input text พร้อมทั้ง auto format number รูปแบบ #,###,##0
/**
* @author jittagornp
* create 16/11/2015
*
* require jQuery - https://code.jquery.com/jquery-1.11.3.min.js
* require numeral - https://cdnjs.cloudflare.com/ajax/libs/numeral.js/1.4.5/numeral.min.js
*/
(function (document, $, numeral, SELECTOR) {
$(function () {