Skip to content

Instantly share code, notes, and snippets.

View korrio's full-sized avatar
👽

kOrriO korrio

👽
  • Hal Finney Co.,Ltd.
  • mempool
  • X @korrio
View GitHub Profile
@korrio
korrio / gist:dd79269933e699c9d54d
Created June 30, 2015 18:15
Android Conversation History
router.get("/chat/:conversationId/history/android", function(req, res, next) {
// params
var conversationId = req.params.conversationId;
var pageParams = ModelMethod.getPageParams(req.query);
// sequel
var base = squel.select()
.field("ch.id")
.field("ch.conversation_id", "conversationId")
.field("ch.sender_id", "senderId")
<?php
use Elasticquent\ElasticquentTrait;
class Post extends Eloquent{
use ElasticquentTrait;
/**
* The database table used by the model.
@korrio
korrio / gist:1e5f7b7d8e0580078417
Created July 5, 2015 06:12
JSON Push Structure
<?php
header('Content-type:text/html; charset=utf-8');
ini_set('display_errors', 'Off');
include("noti.php");
// http://armymax.com/api/noti/?title=ArmyMax%20Conference&m=arai%20na&f=31&n=ArmyMax1&t=1&type=500
// http://armymax.com/api/noti/?title=ArmyMax%20Conference&m=arai%20na%20to%20all&f=31&n=ArmyMax1&t=1&type=500&all=1
$TYPES_loveFeed = 100;
$TYPES_commentFeed = 101;
$TYPES_liveNow = 200;
<?php
header('Content-type:application/json; charset=utf-8');
ini_set('display_errors', 'Off');
include("noti.php");
$TYPES_likeFeed = 100;
$TYPES_commentFeed = 101;
$TYPES_liveNow = 200;
$TYPES_followedYou = 300;
var request = require('request');
var titile = "คุณได้รับข้อความใหม่";
var sender = {id: 6,name:"Hey"};
var message = "นาย " + sender.name + " ได้กดถูกใจคุณ";
var receiverId = 3082;
var notiType = 100;
request({
//uri: "http://api.vdomax.com/noti/",
@korrio
korrio / noti.php
Last active August 29, 2015 14:25
notifySocial
public static function notifySocial($from_id,$from_name,$to_id,$type,$post_id,$all=false)
{
$TYPES_likeFeed = 100;
$TYPES_commentFeed = 101;
$TYPES_shareFeed = 102;
$TYPES_reportFeed = 103;
$TYPES_liveNow = 200; // ??
$TYPES_followedYou = 300;
@korrio
korrio / gist:d58384901e212b972a5d
Created August 8, 2015 09:40
notification.js
'use strict';
//Dep
var request = require('request');
var Q = require("q");
var app = require("./app");
var lodash = require("lodash");
var Model = app.get("Model");
var http = require("http");
/*
@korrio
korrio / gist:b257af9b20a46cb73b04
Created September 10, 2015 05:43
VM Notification Message Template
function notiMessage(notiType) {
var message = "";
if(notiType == 500) {
message = " ได้ส่งข้อความหาคุณ";
} else
if(notiType == 501) {
message = " ส่งแทตทูหาคุณ";
} else if(notiType == 502) {
message = " ส่งรูปภาพหาคุณ";
<?php
class Order
extends Eloquent
{
protected $table = "order";
protected $guarded = ["id"];
protected $softDelete = true;
public function show($order_id)
{
$query = Order::with([
"account",
"orderItems",
"orderItems.product",
"orderItems.product.category"
]);
//$order_id = Input::get("order_id");