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
| { | |
| "success": true, | |
| "data": { | |
| "firstName": "Polawat", | |
| "lastName": "Phetra", | |
| "birthDate": "Thu Sep 11 1969 00:00:00 GMT+0700 (ICT)" | |
| } | |
| } |
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
| { | |
| "success": true, | |
| "user": { | |
| "id": 1, | |
| "name": "pok" | |
| } | |
| } |
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
| +proj=merc +a=6378137 +b=6378137 +lat_ts=0.0 +lon_0=0.0 +x_0=0.0 +y_0=0 +k=1.0 +units=m +nadgrids=@null +wktext +no_defs |
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
| @Secured(['ROLE_USER', 'ROLE_ANONYMOUS']) | |
| class TestController { | |
| def index() { | |
| def ret = [ | |
| name: 'ไทย' | |
| ] | |
| render(contentType: 'application/json; charset=utf-8') { | |
| ret | |
| } | |
| } |
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
| fizz n = "fizz" | |
| buzz n = "buzz" | |
| fizzbuzz n = "fizzbuzz" | |
| as_is n = show n | |
| fn_table = cycle [as_is, as_is, fizz, as_is, buzz, fizz, as_is, as_is, fizz, buzz, as_is, fizz, as_is, as_is, fizzbuzz] | |
| table = zipWith ($) fn_table [1..] | |
| -- *Main> take 100 table |
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 pg = require('pg'); | |
| var async = require('async'); | |
| var _ = require('underscore'); | |
| var when = require('when'); | |
| var conString = "tcp://erp:erp@localhost/poc"; | |
| var authenFn = function(user, password) { |
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 pg = require('pg'); | |
| var conString = "tcp://postgres:1234@localhost/postgres"; | |
| pg.connect(conString, function(err, client, done) { | |
| if(err) { | |
| return console.error('error fetching client from pool', err); | |
| } | |
| client.query('SELECT $1::int AS numbor', ['1'], function(err, result) { |
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 redis = require('redis'); | |
| var client = redis.createClient(); | |
| var pg = require('pg'); | |
| var async = require('async'); | |
| var _ = require('underscore'); | |
| var when = require('when'); | |
| connect("tcp://erp:erp@localhost/poc") | |
| .then(getFeedFromRedis) | |
| .then(getReport) |
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 redis = require('redis'); | |
| var client = redis.createClient(); | |
| var pg = require('pg'); | |
| var async = require('async'); | |
| var _ = require('underscore'); | |
| var conn = new pg.Client("tcp://erp:erp@localhost/poc"); | |
| function getReport(id, callback) { | |
| console.log('getReport ', id); | |
| conn.query('select title from report where id = $1', [id], function(err, result) { |
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
| <html> | |
| <head> | |
| <title>Template</title> | |
| <link rel="stylesheet" href="extjs/resources/css/ext-all.css"> | |
| <script src="extjs/ext-all-debug.js"></script> | |
| <script> | |
| // รอให้ page load เสร้จแล้วค่อยทำงาน | |
| Ext.onReady(function() { | |
| Ext.define('Car', { | |
| extend: 'Ext.data.Model', |