Skip to content

Instantly share code, notes, and snippets.

View tonmanna's full-sized avatar

Worawut Boontan tonmanna

View GitHub Profile
@tonmanna
tonmanna / gist:6b1b7a540fbe432ff1df
Last active August 29, 2015 14:14
ลองดูครับ ขา Data ของ DHT22 ใส่ ขา 6 นะครับ ส่วน Relay ขา 2
#include <dht.h>
dht DHT;
#define DHT22_PIN 6
boolean bActive;
void setup()
{
Serial.begin(9600);
pinMode(2, OUTPUT); // ตั้งค่า 2 เป็น Output
digitalWrite(2, HIGH); // ตั้งค่า Output เป็น High เพื่อ ปิด Relay
bActive = false;
@tonmanna
tonmanna / gist:781524d23eb2365d581a
Created April 2, 2015 09:31
RedisExtensionHelper.cs
public class RedisObject
{
public string key { get; set; }
public byte[] Object { get; set; }
public object Object_Pass { get; set; }
public FileReturn Object_FileReturn
{
get
{
if (key != "")
public static async Task<FileReturn> ShowPhoto(string name, CancellationToken cn)
{
var key = "PIC" + name;
var redisObj = RedisExtensionsPicture.GetData(key);
if (redisObj == null)
{
// <<<<<<< ReadData from physicaldis and store to byte[] >>>>>>>>>>
// byte[] byte = Data
RedisObject obj = new RedisObject();
obj.key = key;
@tonmanna
tonmanna / gist:687e5cf61c228a84750d
Last active August 29, 2015 14:18
MongoDB mongoose ReadData
readStream = gfs.createReadStream({ filename: req.params.param1 }).pipe(res);
@tonmanna
tonmanna / my.cnf
Created July 21, 2016 21:17
MySQL configuraion 5.6 - 5.7 docker machine /etc/mysql/
# Copyright (c) 2014, 2015, Oracle and/or its affiliates. All rights reserved.
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; version 2 of the License.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
@tonmanna
tonmanna / pleskexpiredomain.sql
Created July 28, 2016 08:15
Plesk get Current Active Domain
SELECT d.name dateexpire, FROM_UNIXTIME(l.value) expiredate FROM SubscriptionProperties sp
LEFT JOIN Subscriptions s ON s.id = sp.subscription_id
LEFT JOIN domains d ON d.id = s.object_id
LEFT JOIN Limits l ON l.id = sp.value
WHERE sp.`name` = 'limitsId' AND l.limit_name = 'expiration' AND FROM_UNIXTIME(l.value) > CURDATE()
ORDER BY l.value desc
@tonmanna
tonmanna / pleskexpiredomain.sql
Created July 28, 2016 08:15
Plesk get Current Active Domain
SELECT d.name dateexpire, FROM_UNIXTIME(l.value) expiredate FROM SubscriptionProperties sp
LEFT JOIN Subscriptions s ON s.id = sp.subscription_id
LEFT JOIN domains d ON d.id = s.object_id
LEFT JOIN Limits l ON l.id = sp.value
WHERE sp.`name` = 'limitsId' AND l.limit_name = 'expiration' AND FROM_UNIXTIME(l.value) > CURDATE()
ORDER BY l.value desc
@tonmanna
tonmanna / pleskactive_old.sql
Created July 28, 2016 08:29
Plesk get Active Oldversion Plesk
SELECT dm.name dateexpire, FROM_UNIXTIME(l.value) expiredate FROM domains dm
LEFT JOIN Limits l ON dm.limits_id = l.id
WHERE l.limit_name = 'expiration' AND FROM_UNIXTIME(l.value) > CURDATE()
ORDER BY l.value desc
body{
-moz-filter: grayscale(100%) !important;
-o-filter: grayscale(100%) !important;
-webkit-filter: grayscale(100%) !important;
filter: grayscale(100%) !important;
}
.itopplus-background
{
background-blend-mode: luminosity !important;
@tonmanna
tonmanna / Grayscale.css
Last active October 14, 2016 13:21
Grayscale CSS
img {
-moz-filter: grayscale(100%) !important; /* Chrome, Safari, Opera */
-o-filter: grayscale(100%) !important; /* Chrome, Safari, Opera */
-webkit-filter: grayscale(100%) !important; /* Chrome, Safari, Opera */
filter: grayscale(100%) !important;
}
body{
-moz-filter: grayscale(100%) !important;
-o-filter: grayscale(100%) !important;
-webkit-filter: grayscale(100%) !important;