Skip to content

Instantly share code, notes, and snippets.

View abcprintf's full-sized avatar
🎯
Focusing

Mix Abcprintf abcprintf

🎯
Focusing
View GitHub Profile
@abcprintf
abcprintf / bootstrap3-modal.md
Last active July 14, 2020 03:38
Bootstrap3 remote modal

html

<div class="modal" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
  <div class="modal-dialog">
    <div class="modal-content"></div>
  </div>
</div>

js

export default {
  props: {
    image: {
      type; String,
      default: '/images/placeholder.png'	
      validator: propValue => {
         const hasImagesDirectory = propValue.indexOf('/images/') > -1
         const isPNG = propValue.endsWith('.png')
 const isJPEG = propValue.endsWith('.jpeg') || propValue.endsWith('.jpg')
@abcprintf
abcprintf / datepaicker.js
Created December 1, 2019 06:08
Bootstrap datepicker Disabled out of Range.
// required moment.js
$('#datepicker').datepicker({
autoclose: true,
todayHighlight: true,
format: 'dd/mm/yyyy',
language: 'th',
startDate: moment(rangDateStart).format('DD/MM/YYYY'),
endDate: moment(rangDateEnd).format('DD/MM/YYYY')
});
@abcprintf
abcprintf / preview.js
Created November 19, 2019 04:45
preview files ก่อน upload
function readURL(input) {
if (input.files.length > 1) {
var htmlPreview = $('#preview-files');
htmlPreview.html("");
$.each(input.files, function(i, v) {
var filename = v.name;
var filetype = v.type;
@abcprintf
abcprintf / add_year.md
Created October 31, 2019 02:38
moment เพิ่มปี 543 (พ.ศ)
  moment().add(543, 'years').format('L');
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width">
<title>JS Bin</title>
</head>
<body>
<form>
<div class="form-group">
@abcprintf
abcprintf / server.js
Created June 4, 2019 08:13
Listening on HTTP and HTTPS
// Host runing https:
var port = 3000;
var express = require('express');
var fs = require("fs");
var cert = {
key: fs.readFileSync('./cert/x.key'),
cert: fs.readFileSync('./cert/x.cer')
};
var app = express()
, http = require('http').createServer(app)
<?php
error_reporting(E_ALL);
// Attachments Form :
// $data = array(
// 'attachments' => array(
// 0 => array(
// 'fallback' => 'Required plain-text summary of the attachment.',
// 'color' => '#36a64f',
// 'pretext' => 'Optional text that appears above the attachment block',
@abcprintf
abcprintf / CommandMongoDB.md
Last active June 6, 2019 07:40
Command Mongodb

Command MongoDB

- aggregate
- $unwind
- $match -> where
    - $regex -> like
    - $or -> ||
    - $and -> &&
    - $eq -> =
    - $ne -> !=
    - $nin -> NOT IN
<?php
$apiToken = ""; // Your Token
$chat_id = ""; // Your Chat ID
$text = $_GET['text'];
// V1
/*
$params = [
'chat_id' => $chat_id,