Skip to content

Instantly share code, notes, and snippets.

@hironow
hironow / urltopdf.sh
Last active December 20, 2015 01:19
出力されるPDFファイルは連番でURLを並べたファイルを渡して実行します.ブログ: http://hironow.bitbucket.org/blog/html/2013/07/15/url_to_pdf_script.html
#!/bin/bash
if [ $# -ne 1 ]; then
echo "Error: only one input file is allowed"
exit 1
else
echo "Input: $@"
FILE_NUM=1
for URL in `cat $1`
do
#!/usr/bin/env python
# coding: utf-8
import twitter
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">
#!/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']
@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
@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 / 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 / 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 / .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}"
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.