Skip to content

Instantly share code, notes, and snippets.

View pashango2's full-sized avatar

pashango pashango2

View GitHub Profile
@pashango2
pashango2 / halftone.py
Last active February 27, 2017 12:41
Halftone effect for Python3 and pillow
# coding: utf-8
from PIL import Image, ImageOps, ImageChops, ImageFilter, ImageDraw, ImageDraw2
import math
def create_mat(_rot, _pitch):
_pi = math.pi * (_rot / 180.)
_scale = 1.0 / _pitch
def _mul(x, y):
return (
@pashango2
pashango2 / Makefile.new_t
Last active February 11, 2017 00:53
Sphinx1.5.2 templates
# Minimal makefile for Sphinx documentation
#
# You can set these variables from the command line.
SPHINXOPTS =
SPHINXBUILD = sphinx-build
SPHINXPROJ = {{ project_fn }}
SOURCEDIR = {{ rsrcdir }}
BUILDDIR = {{ rbuilddir }}
@pashango2
pashango2 / file0.txt
Created January 21, 2017 01:34
UbuntuのSpotifyでローカルファイルを再生する ref: http://qiita.com/pashango2/items/8aa66000b1a2aa451ca0
echo deb http://se.archive.ubuntu.com/ubuntu trusty main universe | sudo tee /etc/apt/sources.list.d/temp-trusty.list
echo deb http://security.ubuntu.com/ubuntu trusty-security main universe | sudo tee -a /etc/apt/sources.list.d/temp-trusty.list
sudo apt update
sudo apt install libavcodec54 libavformat54
sudo rm /etc/apt/sources.list.d/temp-trusty.list
sudo apt update
@pashango2
pashango2 / file0.txt
Last active January 4, 2017 23:07
SVGをお手軽に出力するならQtが最強のライブラリではないか? ref: http://qiita.com/pashango2/items/b9f61ab06c78a3e2ccdd
#! usr/bin/python
# -*- coding: utf-8 -*-
from __future__ import unicode_literals, print_function, absolute_import
import sys
from PySide.QtCore import *
from PySide.QtGui import *
from PySide.QtSvg import *
app = QApplication(sys.argv)
@pashango2
pashango2 / finder_object.py
Created December 23, 2016 17:11
汎用検索オブジェクト
#! usr/bin/python
# -*- coding: utf-8 -*-
from __future__ import unicode_literals, print_function, absolute_import
"""
# 汎用検索オブジェクト
QAbstractItemViewに対して付加可能な検索オブジェクト。
ツリー型モデルとテーブル型の両対応をしている。
# 使い方
def model_row_iter(model, start_index=QModelIndex()):
""" モデルのrowイテレータを返す
:type start_index: QModelIndex
:type model: QAbstractItemModel
"""
if start_index.isValid():
yield start_index
while True: