Skip to content

Instantly share code, notes, and snippets.

tomoki megatk

Block or report user

Report or block megatk

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@megatk
megatk / index.py
Last active Jul 9, 2018
Python3 で、MySQL にアクセスする
View index.py
#! /usr/bin/python3
# -*- coding: utf-8 -*-
from mySQLUtil import MySQLUtil
dbx = MySQLUtil(
host='localhost',
user='root',
password='******',
db='test',
@megatk
megatk / encode.py
Created May 21, 2016
Python FTP接続でログファイルを監視する
View encode.py
# -*- coding:utf-8 -*-
import os
# 文字コード自動判別
def analyzeEncode(file, content=''):
lookup = ('shift_jis','euc-jp','utf-8','iso-2022-jp','ascii')
encode = []
if os.path.exists(file):
@megatk
megatk / myLogger.php
Created Oct 3, 2015
PHP monologをカスタマイズ
View myLogger.php
<?php
// ★ composerでmonologをインストールしている前提
require_once('vendor/autoload.php');
use Monolog\Logger;
use Monolog\Handler\StreamHandler;
use Monolog\Processor\WebProcessor;
use Monolog\Formatter\LineFormatter;
class myLogger
View Wunderlist.php
<?php
class WunderList
{
protected $client_id;
protected $client_secret;
protected $redirect_url;
protected $state;
protected $access_token;
protected $header = array();
@megatk
megatk / groupbyApacheLog
Last active Aug 29, 2015
Apache のログをグルーピングして出力するスクリプト
View groupbyApacheLog
#!/bin/sh
#
# 名称
# groupbyApacheLog - Apacheログを指定項目でグルーピング
#
# 書式
# groupbyApacheLog [-s] [-tz] target LogFile
#
# -s
# 静的ファイル(.js .css .html .jpg .gif .png)含める
You can’t perform that action at this time.