Skip to content

Instantly share code, notes, and snippets.

View limweb's full-sized avatar

Thongchai Lim (样生海) limweb

View GitHub Profile
# How to use
# Make sure you install curl. By running curl -v to test it.
# Provide your Gmail username and password and who you need to send email to.
# For password it is not your Gmail password but it is App passwords https://support.google.com/mail/answer/185833. Please go to your Gmail account setting and create it.
# chmod -R 777 send-email-gmail-thai.com
# ./send-email-gmail-thai.com
# Your Gmail username (email) (Required)
SENDER_GMAIL_USERNAME=
# Your App password (Required)
# How to use
# Make sure you install curl. By running curl -v to test it.
# Provide your Gmail username and password and who you need to send email to.
# For password it is not your Gmail password but it is App passwords https://support.google.com/mail/answer/185833. Please go to your Gmail account setting and create it.
# chmod -R 777 send-email-gmail.com
# ./send-email-gmail.com
# Your Gmail username (email) (Required)
SENDER_GMAIL_USERNAME=
# Your App password (Required)
@limweb
limweb / gist:ffbb684b047f284e643e0c05671155d3
Created October 13, 2020 18:41 — forked from mhawksey/gist:1442370
Google Apps Script to read JSON and write to sheet
function getJSON(aUrl,sheetname) {
//var sheetname = "test";
//var aUrl = "http://pipes.yahoo.com/pipes/pipe.run?_id=286bbb1d8d30f65b54173b3b752fa4d9&_render=json";
var response = UrlFetchApp.fetch(aUrl); // get feed
var dataAll = JSON.parse(response.getContentText()); //
var data = dataAll.value.items;
for (i in data){
data[i].pubDate = new Date(data[i].pubDate);
data[i].start = data[i].pubDate;
}
@limweb
limweb / Dockerfile
Created February 17, 2021 22:36 — forked from yozik04/Dockerfile
PHP 7 fpm, alpine, mongodb and composer
FROM php:7-fpm-alpine
RUN apk --update add --virtual build-dependencies build-base openssl-dev autoconf \
&& pecl install mongodb \
&& docker-php-ext-enable mongodb \
&& apk del build-dependencies build-base openssl-dev autoconf \
&& rm -rf /var/cache/apk/*
# Time Zone
RUN echo "date.timezone=${PHP_TIMEZONE:-UTC}" > $PHP_INI_DIR/conf.d/date_timezone.ini
@limweb
limweb / main.go
Created March 16, 2021 11:00 — forked from yingray/main.go
Golang: aes-256-cbc examples (with iv, blockSize)
package main
import (
"bytes"
"crypto/aes"
"crypto/cipher"
"encoding/hex"
"fmt"
)
@limweb
limweb / odoo-pgpool.md
Created December 9, 2021 18:45 — forked from akhdaniel/odoo-pgpool.md
Odoo + PGPOOL II

PG+PGPOOL docker compose file

version: '2'

networks:
  my-network:
    driver: bridge
services:
  pg-0:
@limweb
limweb / php-soap.php
Created March 23, 2022 13:04 — forked from akalongman/php-soap.php
PHP soap client example
ini_set('soap.wsdl_cache_enabled', 0);
ini_set('soap.wsdl_cache_ttl', 900);
ini_set('default_socket_timeout', 15);
$params = array('param1'=>$param1);
$wsdl = 'http://service_url/method?WSDL';
@limweb
limweb / web-service-soap-client-server-php.md
Created March 23, 2022 13:05 — forked from umidjons/web-service-soap-client-server-php.md
Simple Web service - SOAP Server/Client in PHP

Simple Web service - SOAP Server/Client in PHP

Implementation of the SOAP server - server.php:

<?php
// turn off WSDL caching
ini_set("soap.wsdl_cache_enabled","0");

// model, which uses in web service functions as parameter
@limweb
limweb / CodeBook.php
Created November 10, 2022 07:51 — forked from comuttun/CodeBook.php
PHP Encrypt Sample with CodeBook.php
<?php
/**
* CodeBook.php
* @version 0.2.1
* @see http://0-oo.net/sbox/php-tool-box/code-book
* @copyright 2009-2011 [email protected]
* @license http://0-oo.net/pryn/MIT_license.txt (The MIT license)
*/
class CodeBook {
/** PKCS#5でパディング */
@limweb
limweb / Aes.php
Created November 10, 2022 07:52 — forked from senowbar/Aes.php
AES encryption and decryption
<?php
class Aes
{
private static $key = 'your_key';
private static $iv = 'your_iv';
public static function encrypt($data)
{