Skip to content

Instantly share code, notes, and snippets.

class myFTPS(FTP):
def __init__(self, host='', user='', passwd='', acct='',
timeout=_GLOBAL_DEFAULT_TIMEOUT, source_address=None, *,
encoding='utf-8'):
super().__init__(host='', user='', passwd='', acct='',
timeout=_GLOBAL_DEFAULT_TIMEOUT, source_address=None, *,
encoding='utf-8')
def storbinary(self, cmd, fp, blocksize=8192, callback=None, rest=None):
@hashihei
hashihei / DroppableArea.js
Last active May 8, 2022 06:18
react-dropzone set useState
import React, { useCallback, useState, useContext } from 'react'
import { useDropzone } from 'react-dropzone'
import { Store } from '../store/index'
const dropAreaStyle = {
width: "100%",
height: "100px",
backgroundColor: "#eeeeee",
display: "flex",
alignItems: "center",
import sys
import numpy as np
def numPrint(num):
print("numprint:" + str(num))
if __name__ == '__main__':
args = sys.argv
@hashihei
hashihei / gist:f8337a0b6644e0031df5a73e62a84e07
Created December 28, 2019 12:59
WordPress_tag_reference
/*記事に紐づけられたタグ配列情報を取得*/
$tags = get_the_tags();
/*タグ情報が空かどうかを確認*/
if ( !empty( $tags ) ) {
/*タグ情報が設定されている場合は、1つ目のタグ情報を読み取り、
fontawsomeのタグを構成し、出力する */
echo '<div><i class="' . $tags[0]->description . '"></i><div>' . $tags[0]->name . '</div></div>';
}else{
<!doctype html>
<html class="no-js" lang="">
<head>
<meta charset="utf-8">
<meta http-equiv="x-ua-compatible" content="ie=edge">
<title>myfirstpage</title>
<!-- <meta name="description" content=""> -->
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<!-- <link rel="manifest" href="site.webmanifest"> -->
<!-- <link rel="apple-touch-icon" href="icon.png"> -->
@hashihei
hashihei / app-models-myfirstModel.php
Created May 26, 2019 07:54
[myfirstcontroller]Model
<?php
namespace App\models;
use Illuminate\Database\Eloquent\Model;
use Illuminate\Support\Facades\DB;
class mysqlModel extends Model
{
//getMariaDBUserlist
public function getUsers()
<?php
namespace App\Http\Controllers;
use Illuminate\Http\Request;
class myfirstController extends Controller
{
public function index()
{
//user php function
$user_agent = $_SERVER['HTTP_USER_AGENT'];
$user_ip = $_SERVER['REMOTE_ADDR'];
@hashihei
hashihei / myfirstcontroller-routes-web.php
Last active May 26, 2019 07:34
[myfirstcontroller]ルーティング
Route::get('/', function () {
return view('welcome');
});
Route::get('myfirstpage', 'myfirstController@index');