Skip to content

Instantly share code, notes, and snippets.

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet-0.7.2/leaflet.css" />
<!--[if lte IE 8]>
<link rel="stylesheet" href="http://cdn.leafletjs.com/leaflet-0.7.2/leaflet.ie.css" />
<![endif]-->
<script src="http://cdn.leafletjs.com/leaflet-0.7.2/leaflet.js"></script>
<script src="http://www.mapquestapi.com/sdk/leaflet/v1.0/mq-map.js?key=Fmjtd%7Cluur2d08lu%2Cra%3Do5-9a829f"></script>
@t2psyto
t2psyto / graphtest5.py
Created August 5, 2014 07:19
matplotlibでwindowパフォーマンスログのCSVからグラフ描画する。
# -*- coding: cp932 -*-
import datetime as DT
import os, csv, re
# np.nan as NaN
import numpy as np
from matplotlib import pyplot as plt
from matplotlib import dates
from matplotlib.dates import date2num
@t2psyto
t2psyto / gist:99d2f7b48238894ddf2a
Created September 2, 2014 05:08
desknets neo logon token
# id, password
> set dneo_user=userid
> set dneo_passwd=password
# ログイン トークンを取得
> curl -F cmd=certify -F nexturl=dneo.exe%3Fcmd%3Dlogin -F svuid= -F starttab=1 -F UserID=%dneo_user% -F _word=%dneo_passwd% http://dneo/scripts/dneo/dneor.exe
{"status":"ok","rssid":"sidsidsidsidsidisd","STOKEN":"tokentoketokentoketoken","Name":"--------","id":"99","Group":"00","Mail":"hogehoge@example.com","UserID":"userid"}
# ログイン セッション用の cookie 生成
@t2psyto
t2psyto / sh
Created December 6, 2014 16:09
json を pretty print するPythonワンライナー。日本語をエスケープしない。 ref: http://qiita.com/t2psyto/items/123f22669c6d94d53c5f
$ echo '{"one":1, "two":2, "日本語":"あああ"}' | python -mjson.tool
{
"one": 1,
"two": 2,
"\u65e5\u672c\u8a9e": "\u3042\u3042\u3042"
}
def wand2pil(image):
width, height = image.size
depth = image.depth
if image.colorspace == 'gray':
channs = 1
fmt = 'gray'
else:
channs = 3
fmt = 'RGB'
image.depth = 16
@t2psyto
t2psyto / emacsclientw.vbs
Last active August 29, 2015 14:22 — forked from valda/emacsclientw.vbs
emacsclient のラッパスクリプトemacs.exe プロセスの有無と引数の有無に応じて startup_emacs.exe、startup_emacsclient.exe を起動。
'
' C:\gnupack_devel\emacsclientw.vbs
'
Set objShell = WScript.CreateObject("WScript.Shell")
Set fso = CreateObject("Scripting.FileSystemObject")
strComputer = "."
Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
Set colItems = objWMIService.ExecQuery("Select * From Win32_Process")
Dim emacsProcess
@t2psyto
t2psyto / esp8266_arduinoIDE_setting.png
Last active September 2, 2015 16:01
esp8266_wifi_httpclient
esp8266_arduinoIDE_setting.png
@t2psyto
t2psyto / wstest.html
Last active September 14, 2015 19:49 — forked from anonymous/wstest.html
ibm bluemix websocket test
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<script type="text/javascript" src="https://www.google.com/jsapi"></script>
<script src="http://code.jquery.com/jquery-1.11.0.min.js"></script>
<script src="http://code.jquery.com/jquery-migrate-1.2.1.min.js"></script>
<script>
//グーグルチャートの読み込み
google.load("visualization", "1", {packages:["corechart"]});
@t2psyto
t2psyto / esp8266_mqtt_bluemix.ino
Created September 14, 2015 19:51
esp8266_mqtt_bluemix
/*
You'll need the information below, get these after adding a device. I'm using the MAC address as the device's ID.
org=[org-id]
type=[device-type]
id=[device-id]
auth-method=token
auth-token=[auth-token]
*/
@t2psyto
t2psyto / gist:3550904
Created August 31, 2012 09:41
jscript な coffeescript で console.log() したいとき
# console.log()
# for jscript coffee.bat
# https://github.com/thinca/coffee-script-on-jscript
if (typeof console == "undefined")
console = new class
log: (message) ->
WScript.Echo(message)