Skip to content

Instantly share code, notes, and snippets.

@nao-pon
nao-pon / setup-dashbutton.py
Last active Apr 13, 2020 — forked from fffonion/setup-dashbutton.py
Setting up dash button without Amazon App
View setup-dashbutton.py
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"
View amazon-csv.js
// 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
Multiple editor setting for elFinder >= 2.1.25
View commandsOptions.js
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 Dec 21, 2016 — forked from mungurs/leafFileSync.php
elFinder file sync. with db
View leafFileSync.php
<?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 Aug 31, 2016 — forked from hakre/iconv-l.txt
Iconv List of Encodings
View iconv-l.txt
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
View elfinder.full.js
/*!
* 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($) {
View xpressme_php7.patch
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 Mar 11, 2015
Show server side locales
View showlocale.php
<?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 Mar 11, 2015
Show server side locales
View gist:afabcc2f7b87450c578b
<?php
exec('locale -a', $out, $ret);
header('Content-type: text/plain');
if ($ret === 0) {
echo join("\n", $out);
} else {
echo 'Error: locale -a';
}
View rmdir_recursive.class.php
<?php
class rmdir_recursive
{
private function rmdir($path) {
if (is_dir($path)) {
if ($handle = opendir($path)) {
while (false !== ($entry = readdir($handle))) {
if ($entry !== '.' && $entry !== '..' && !$this->rmdir($path . DIRECTORY_SEPARATOR . $entry)) {
return false;
}
You can’t perform that action at this time.