Skip to content

Instantly share code, notes, and snippets.

View muchrm's full-sized avatar
😃

Pongpanot Chuaysakun muchrm

😃
  • LINE THAILAND
  • Thailand
  • 11:03 (UTC +07:00)
View GitHub Profile
import { Directive, ElementRef, HostListener, Input, Output, EventEmitter } from '@angular/core';
import * as XLSX from 'xlsx'
@Directive({
selector: '[appXlsx]'
})
export class XLSXDirective {
@Output() onSuccess = new EventEmitter()
constructor(private el: ElementRef) {
}
import { Injectable } from '@angular/core';
import { environment } from '../../../environments/environment';
import { HttpHeaders, HttpClient, HttpParams } from '@angular/common/http';
import { Observable } from 'rxjs/Rx';
import { Router } from '@angular/router';
import 'rxjs/add/operator/map';
import 'rxjs/add/operator/catch';
import { JwtService } from './jwt.service';
<?php
namespace App\Meetvote\PDF;
abstract class PDF
{
protected $phpWord;
protected $docx_path;
protected $templateProcessor;
public function __construct($templateName)
{
$this->templateProcessor = new \PhpOffice\PhpWord\TemplateProcessor(resource_path('views/template-pdf/'.$templateName));
@muchrm
muchrm / add-products.component.ts
Last active September 8, 2017 04:57
ของอิ้น
addCart(product) {
this.cartService.addCart();
}
@muchrm
muchrm / php-code-inspection.md
Created September 17, 2017 07:21
How to install PHP code inspection tools using homebrew-php and how to integrate with JetBrain's IntelliJ or PhpStorm

#Inspection Tools with homebrew-php#

##Prerequisites##

  • Homebrew is installed

##Step 1: Installing homebrew-php##

  1. brew tap homebrew/dupes
  2. brew tap josegonzalez/homebrew-php
  3. brew install PHP53 (or other version of your choice)
import * as request from 'request-promise';
export class Kong {
constructor(
private readonly baseUrl,
) { }
get(path) {
return this.request('GET', path);
}
post(path, body) {
@muchrm
muchrm / global-state.enum.ts
Last active May 21, 2021 16:34
Simple Global State
export enum GlobalState {
Layout = 1,
User = 3,
MaxColumn = 5
}
usort($courses, function($a, $b) {
$vala = $a['courseCode'];
$valb = $b['courseCode'];
if($vala >= 1000000){
$vala = intval($vala/100);
}
if($valb >= 1000000){
$valb = intval($valb/100);
}
if($vala < $valb){
##cloud Hosted
socket.io
pusher.com
Faye https://github.com/faye/faye
Scaledrone https://www.scaledrone.com
Ably: https://www.ably.io
Contus Fly
Fanout: http://fanout.io/
Firebase https://www.firebase.com
Gamooga: http://www.gamooga.com/
@muchrm
muchrm / vibie.play
Created January 17, 2018 16:50 — forked from narate/vibie.play
ffplay live from vibie.live required ffmpeg --with-ffplay and jq
#!/bin/bash
LIVE_DATA=$(curl -s "$1" | grep __NEXT_DATA__ | sed 's/__NEXT_DATA__ =//g')
STATUS=$(echo $LIVE_DATA | jq '.props.live.status' | sed 's/"//g')
if [ $STATUS == "inactive" ]
then
echo "ERROR: live status is $STATUS"
exit -1
fi