Skip to content

Instantly share code, notes, and snippets.

@hrsano645
hrsano645 / subprocess_silent_call_acrobat.py
Created July 2, 2015 12:29
Printing PDF File at windows and python. Use subprocess module and Adobe Acrobat Commandline Option Silent Mode
# coding: utf-8
from __future__ import division, print_function, absolute_import, unicode_literals
import subprocess
import sys
# ref: https://geonet.esri.com/thread/59446
# ref: https://helpx.adobe.com/jp/acrobat/kb/510705.html
@hrsano645
hrsano645 / win32api_ShellExecute_print.py
Created July 2, 2015 12:43
Printing PDF File at windows and python. Use PyWin32 Package win32api.ShellExecute module
# coding: utf-8
from __future__ import division, print_function, absolute_import, unicode_literals
# ref: http://timgolden.me.uk/python/win32_how_do_i/print.html
# ref: http://docs.activestate.com/activepython/2.7/pywin32/win32api__ShellExecute_meth.html
import win32api
import sys
@hrsano645
hrsano645 / subprocess_call_gsprint.py
Last active August 29, 2015 14:24
Printing PDF File at windows and python. Use GSPrint comanndline tool
# coding: utf-8
from __future__ import division, print_function, absolute_import, unicode_literals
import subprocess
import sys
# ref: http://stackoverflow.com/questions/4498099/silent-printing-of-a-pdf-in-python
# ref: http://stackoverflow.com/questions/1462842/print-pdf-document-with-pythons-win32print-module
@hrsano645
hrsano645 / nihongo_greeting
Created December 8, 2017 02:43
python3の日本語でクラスを作った話
class 日本語挨拶:
def __init__(self, 名前):
self.名前 = 名前
def 朝(self):
print("{}さん おはようございます".format(self.名前))
def 昼(self):
print("{}さん こんにちは!".format(self.名前))
def 晩(self):
print("{}さん こんばんは".format(self.名前))
def はまちちゃん(self):
import subprocess
import datetime
from pprint import pprint
ROUTER = ""
NW = ""
RUN_COUNT = 2
speedtest_command = "speedtest-cli --server 15047".split(" ")
#define BLYNK_USE_DIRECT_CONNECT
#define BLYNK_PRINT Serial
#include <BlynkSimpleSerialBLE.h>
#include <Adafruit_BLE.h>
#include <Adafruit_BluefruitLE_SPI.h>
#include <SPI.h>
#include <OneWire.h>
#include <DallasTemperature.h>
@hrsano645
hrsano645 / dyndns_route53.py
Created May 15, 2018 05:44 — forked from mariocesar/dyndns_route53.py
Update a Route53 Record if your public IP changes. Like DynDNS
"""
Requeriments:
$ sudo pip install boto dnspython
Edit ~/.boto to use your AWS credentials
"""
import time
import sys
function createWebhook(){
// プロパティを設定してから必要な情報を取り出す
// 参考:https://qiita.com/0Delta/items/7d8303eebbff4062069e
var scriptProp = PropertiesService.getScriptProperties().getProperties();
var trelloKey = scriptProp.TRELLO_API_KEY;
var trelloToken = scriptProp.TRELLO_TOKEN;
// Trello WebhookへCallback URLを登録する手順
// 1. 登録用のURL生成のために、GASのWEBアプリケーションの公開を以下のように変更してURLを生成する
import asyncio
from pyppeteer import launch
from pathlib import Path
import time
# ref:https://qiita.com/horikeso/items/69528c2b21ede15a56ee
download_path = "./download"
import asyncio
from pyppeteer import launch
from pathlib import Path
# ref:https://qiita.com/horikeso/items/69528c2b21ede15a56ee
download_path = Path("./download")
async def main():