Skip to content

Instantly share code, notes, and snippets.

@dev001hajipro
dev001hajipro / main.go
Last active June 28, 2018 14:54 — forked from yomusu/csvblob.go
Go appengine : csv upload(blob) & parse. 2018/06/28 change import to "context" and "google.golang.org/appengine/*"
package main
import (
"context"
"html/template"
"io"
"net/http"
"encoding/csv"
"strings"
function setup() {
createCanvas(500, 500);
colorMode(HSB, 255);
}
function draw() {
background(0, 50, 50);
var t = frameCount / 5;
var t2 = frameCount / 2;
@dev001hajipro
dev001hajipro / sketch.js
Last active May 15, 2018 05:09
円をつなぐ線 p5.js
// https://stackoverflow.com/questions/4856717/javascript-equivalent-of-pythons-zip-function
// ex:
// zip([[1,2,3],['a','b','c']])
// [[1,'a'],[2, 'b'], [3, 'c']]
const zip = rows => rows[0].map((_, c) => rows.map(row => row[c]));
function makeCirclePoints(degs, t, offsetX, offsetY) {
return degs.map(deg => ({
"x": cos(radians(deg + t)) * 50 + offsetX,
"y": sin(radians(deg + t)) * 50 + offsetY,
@dev001hajipro
dev001hajipro / study_clojure_01.clj
Created November 2, 2017 22:16
clojureを勉強したときのコード。
(ns study-clojure.core
(:require [clojure.java.io :as io])
(:import (java.util Date))
(:gen-class))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; UTIL
(defn now []
"the dot of 'Date.' means instanciate 'now' in Java.
same like (new java.util.Date)"
@dev001hajipro
dev001hajipro / run_notepad_and_move2.py
Created October 12, 2017 13:55
Python3.6とctypesでメモ帳を起動し、Win32APIで移動、リサイズ
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
メモ帳起動して、移動
https://gist.github.com/miau/565417
"""
import subprocess
import time
@dev001hajipro
dev001hajipro / run_notepad_and_move.py
Created October 12, 2017 08:09
Python3.6でメモ帳起動して、移動とリサイズをするサンプルスクリプト
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
メモ帳起動して、移動
# インストール
pip install pywin32
pip install win32gui
@dev001hajipro
dev001hajipro / excel_com.py
Created October 12, 2017 00:59
COMを使ってPythonからExcelを操作する簡単なソースコード
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""COMでPythonからExcelを操作する
"""
import os
from win32com.client import Dispatch
def main():
@dev001hajipro
dev001hajipro / hello_excel.py
Created October 11, 2017 08:02
openpyxlでExcelを操作
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import openpyxl
import os
def recreate_data(filename):
if os.path.exists(filename):
os.remove(filename)
@dev001hajipro
dev001hajipro / type_keyboard.py
Created October 11, 2017 03:10
pyautoguiでイメージ認識、キーボード入力
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
pyautoguiでイメージ認識、キーボード入力
メモ帳を画面キャプチャしてmemo.pngとして保存する必要あり。
"""
import pyautogui
@dev001hajipro
dev001hajipro / hello_pyautogui.py
Created October 9, 2017 02:16
pyautoguiでマウスを移動してみる
#!/usr/bin/env python
"""
pyautoguiを使う
"""
import pyautogui
class Status:
def __init__(self):
self.x, self.y = pyautogui.position()