Skip to content

Instantly share code, notes, and snippets.

@nao-pon
nao-pon / switches.yaml
Last active July 19, 2022 14:47
[HomeAssistant] 電流計付きスマートプラグとスマートIRによる家電コントロール
# sensor.xiao_fei_dian_liu_3: 電流センサー
# input_number.living_sen_on_current: オンと判定する最低電流(ヘルパー)
# input_number.living_sen_off_current: オフと判定する最高電流(ヘルパー)
- platform: template
switches:
living_fan:
unique_id: living_fan
value_template: >-
{%- if (is_state('sensor.xiao_fei_dian_liu_3', 'unavailable')) -%}
{{states('switch.living_fan')}}
@nao-pon
nao-pon / setup-dashbutton.py
Last active February 13, 2021 12:52 — forked from fffonion/setup-dashbutton.py
Setting up dash button without Amazon App
import requests
import re
import sys
# Initial work from: https://mpetroff.net/2016/07/new-amazon-dash-button-teardown-jk29lp/
h = requests.Session()
BASE_URL = "http://192.168.0.1"
// Amazonの注文履歴をCSV形式にして出力するスクリプト
//
// 以下のスクリプトを参考に作成されました。
// http://moroya.hatenablog.jp/entry/2013/06/03/225935
//
// CSVに成型しているのは14行目から定義されているformatEntryという関数なので、これを書き換えれば自由な書式で出力できます。
(function(){
// 各注文履歴をCSVフォーマットにして返す
var datePattern = new RegExp("(\\d{4})年(\\d{1,2})月(\\d{1,2})日");
@nao-pon
nao-pon / commandsOptions.js
Last active May 29, 2017 00:03
Multiple editor setting for elFinder >= 2.1.25
commandsOptions : {
edit : {
binMimeRegex : /^image\/(?:jpeg|png)/,
editors : [
{
// Adobe Creative SDK Creative Tools Image Editor UI
// MIME types to accept
info : {
name : 'Creative Cloud'
},
@nao-pon
nao-pon / leafFileSync.php
Created December 21, 2016 00:17 — forked from mungurs/leafFileSync.php
elFinder file sync. with db
<?php
class leafFileSync{
private $enableLog = false;
public function __construct($logSynchronization = false){
$this->enableLog = $logSynchronization;
}
public function sync($cmd, $result, $args, elFinder $elFinder, elFinderVolumeDriver $volume){
@nao-pon
nao-pon / iconv-l.txt
Created August 31, 2016 08:49 — forked from hakre/iconv-l.txt
Iconv List of Encodings
ANSI_X3.4-1968 ANSI_X3.4-1986 ASCII CP367 IBM367 ISO-IR-6 ISO646-US ISO_646.IRV:1991 US US-ASCII CSASCII
UTF-8
ISO-10646-UCS-2 UCS-2 CSUNICODE
UCS-2BE UNICODE-1-1 UNICODEBIG CSUNICODE11
UCS-2LE UNICODELITTLE
ISO-10646-UCS-4 UCS-4 CSUCS4
UCS-4BE
UCS-4LE
UTF-16
UTF-16BE
/*!
* elFinder - file manager for web
* Version 2.1.9 (2.1-src Nightly: 0878b27) (2016-03-14)
* http://elfinder.org
*
* Copyright 2009-2016, Studio 42
* Licensed under a 3 clauses BSD license
*/
(function($) {
diff -r -u xpressme_integration_kit/admin/index.php php7_patch/admin/index.php
--- xpressme_integration_kit/admin/index.php 2014-09-26 16:17:37.008000000 +0900
+++ php7_patch/admin/index.php 2015-05-07 11:04:59.910887800 +0900
@@ -164,6 +164,7 @@
global $xoopsModule;
include(dirname(__FILE__) . '/../wp-includes/version.php');
require_once dirname(dirname( __FILE__ )).'/include/memory_limit.php' ;
+ $db =& XoopsDatabaseFactory::getDatabaseConnection();
if ($is_report) {
@nao-pon
nao-pon / showlocale.php
Created March 11, 2015 00:24
Show server side locales
<?php
exec('locale -a', $out, $ret);
header('Content-type: text/plain');
if ($ret === 0) {
echo join("\n", $out);
} else {
echo 'Error: locale -a';
}
@nao-pon
nao-pon / gist:afabcc2f7b87450c578b
Created March 11, 2015 00:22
Show server side locales
<?php
exec('locale -a', $out, $ret);
header('Content-type: text/plain');
if ($ret === 0) {
echo join("\n", $out);
} else {
echo 'Error: locale -a';
}