Skip to content

Instantly share code, notes, and snippets.

View aonrobot's full-sized avatar
💭
I may be slow to respond.

Auttawut Wiriyakreng aonrobot

💭
I may be slow to respond.
View GitHub Profile
@aonrobot
aonrobot / index
Last active December 19, 2015 07:09
<?php
echo"Frist PHP on Github";
?>
@aonrobot
aonrobot / Calculate Number of day.py
Created March 1, 2017 03:07
Calculate Number of day created by Auttawut Wiriyakreng - https://repl.it/GBrU/0
import math
import time
import datetime
def tm(yy,mm,dd):
s = str(dd) + "/" + str(mm) + "/" + str(yy)
return time.mktime(datetime.datetime.strptime(s, "%d/%m/%Y").timetuple())
y = 2017
m = 2
<key>NSAppTransportSecurity</key>
<dict>
<key>NSAllowsArbitraryLoads</key>
<true/>
<key>NSExceptionDomains</key>
<dict>
<key>metrosystems.co.th</key>
<dict>
<key>NSExceptionAllowsInsecureHTTPLoads</key>
<true/>
@aonrobot
aonrobot / httpd-vhosts.conf
Last active January 31, 2018 04:22
httpd-vhosts.conf for lumen in subfolder
<VirtualHost *:80>
Alias /icard "C:/xampp/htdocs/icard/public"
# Rewrite all requests in /icard to server index.php
<Location /icard>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ /icard/index.php [L]
#
# This is the Apache server configuration file providing SSL support.
# It contains the configuration directives to instruct the server how to
# serve pages over an https connection. For detailed information about these
# directives see <URL:http://httpd.apache.org/docs/2.4/mod/mod_ssl.html>
#
# Do NOT simply read the instructions in here without understanding
# what they do. They're here only as hints or reminders. If you are unsure
# consult the online docs. You have been warned.
#
@aonrobot
aonrobot / Util.php
Created February 2, 2018 04:19
asset in laravel lumen
<?php
namespace Library;
class Util{
/**
* Generate an asset path for the application.
*
* @param string $path
@aonrobot
aonrobot / composer.json
Created February 2, 2018 04:21
autoload for new library in laravel lumen
"autoload": {
"psr-4": {
"App\\": "app/",
"Library\\": "app/Library"
}
},
'disks' => [
'ftp' => [
'driver' => 'ftp',
'host' => 'xxxx',
'port' => 21,
'username' => 'xxxx',
'password' => 'xxxx',
'passive' => false,
'utf8' => true
jQuery.ajax({
url: API_URL,
data: {header : headerTitle, data : bodyJson},
method: 'POST',
cache:false,
xhrFields:{
responseType: 'blob',
withCredentials: true
},
success: function(result){
function exportXLSX(blob){
if (typeof window.navigator.msSaveBlob === 'function') {
window.navigator.msSaveBlob(blob, "export-" + new Date().getTime() + ".xlsx");
} else {
var link = document.createElement('a');
link.href = window.URL.createObjectURL(blob);
link.download = "export-" + new Date().getTime() + ".xlsx";
document.body.appendChild(link);
link.click();
}