Skip to content

Instantly share code, notes, and snippets.

@hironow
hironow / index.html
Last active August 29, 2015 14:28
D3 Test
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<style>
rect {
fill: #333;
}
</style>
</head>
Hello World!
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@hironow
hironow / .bash_profile
Last active August 29, 2015 14:02
Path for GMT
# PATH for GMT
export PATH="/Applications/GMT-5.1.1.app/Contents/Resources/bin:${PATH}"
@hironow
hironow / gmt_subprocess_redirect.py
Last active August 29, 2015 14:02
Using GMT from Python by subprocess and shlex packages (redirect).
# -*- coding: utf-8 -*-
from __future__ import (absolute_import, division,
print_function, unicode_literals)
from future_builtins import *
import shlex
import subprocess
import os
class ScriptRunningError(Exception):
@hironow
hironow / gmt_subprocess.py
Last active August 29, 2015 14:02
Using GMT from Python by subprocess and shlex packages.
# -*- coding: utf-8 -*-
from __future__ import (absolute_import, division,
print_function, unicode_literals)
from future_builtins import *
import shlex
import subprocess
import os
script = "gmt --version"
output_file = 'sample.txt'
@hironow
hironow / master.html
Last active August 29, 2015 14:02
python-twitter + wheezy.template, #imas
<!DOCTYPE html>
<html lang="ja">
<head>
<meta charset="utf-8">
<title>
@def title():
@end
@title()\
</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
@hironow
hironow / jaholidays.py
Last active August 29, 2015 14:01
Get japanese holidays list by google calendar.
# -*- coding: utf-8 -*-
from datetime import date
import requests
def getHolidays(year, country='ja'):
"""Get holidays list by year.
:param int year: year
:param str country: country code, future work
#!/usr/bin/env python
# coding: utf-8
import tweepy
import tw_key
CONSUMER_KEY = tw_key.twdict['cons_key']
CONSUMER_SECRET = tw_key.twdict['cons_sec']
ACCESS_TOKEN_KEY = tw_key.twdict['accto_key']
ACCESS_TOKEN_SECRET = tw_key.twdict['accto_sec']
<!DOCTYPE html>
<html lang="ja">
<head>
<meta charset="utf-8">
<title>{{ title }}</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<!-- Bootstrap core CSS -->
<link rel="stylesheet" href="https://netdna.bootstrapcdn.com/bootstrap/3.0.3/css/bootstrap.min.css">
<!-- Custom styles for this template -->
<style type="text/css">