Skip to content

Instantly share code, notes, and snippets.

View fukumame's full-sized avatar
💻
Enjoy coding

Atsushi Fukuda fukumame

💻
Enjoy coding
View GitHub Profile
from vidgear.gears import VideoGear
import numpy as np
import cv2
def center_crop(img, dim):
if img is None:
return None
width, height = img.shape[1], img.shape[0]
@fukumame
fukumame / google_sheet_api.js
Last active August 11, 2017 13:31
test script of google sheet api.
const fs = require('fs');
const readline = require('readline');
const google = require('googleapis');
const googleAuth = require('google-auth-library');
// If modifying these scopes, delete your previously saved credentials
// at ~/.credentials/sheets.googleapis.com-nodejs-quickstart.json
const SCOPES = ['https://www.googleapis.com/auth/spreadsheets.readonly'];
const TOKEN_DIR = (process.env.HOME || process.env.HOMEPATH ||
process.env.USERPROFILE) + '/.credentials/';
@fukumame
fukumame / google_drive_api.rb
Last active August 11, 2017 02:54
Google Drive APIへの接続
require 'google/apis/drive_v3'
require 'googleauth'
require 'googleauth/stores/file_token_store'
require 'fileutils'
OOB_URI = 'urn:ietf:wg:oauth:2.0:oob'
APPLICATION_NAME = 'Drive API Ruby Quickstart'
CLIENT_SECRETS_PATH = 'client_secret.json'
# ファイル名もgoogle serviceの名前に合わせて変更する。(この名前は任意の値でOK)
@fukumame
fukumame / disable_chatwork_to_of_task.js
Last active July 27, 2017 12:06
チャットワークのTask本文の To/Re を無効化するボタンを追加するスクリプト
var buttonHTML = '<input type="button" value="TO/RE 無効化" />';
var replaceToText = function () {
var taskContentTextArea = $('#_taskNameInput');
var orgText = taskContentTextArea.val();
var replacedText = orgText.replace(/\[To\:.*\]/g, 'TO ');
replacedText = replacedText.replace(/\[返信.*\]/g, 'RE ')
taskContentTextArea.val(replacedText);
}
$(buttonHTML).appendTo('div.addTaskContainer__submitContainer')
.click(replaceToText);