Skip to content

Instantly share code, notes, and snippets.

__pycache__
@podhmo
podhmo / testutil.py
Last active August 29, 2015 14:18 — forked from tomoh1r/testutil.py
# -*- coding: utf-8 -*-
from datetime import datetime
import contextlib
import unittest
@contextlib.contextmanager
def mock_datetime_now(module_path, return_value):
"""
適当なモジュールの datetime.now() を mock し、適当な日付を返すようにする。
@podhmo
podhmo / browse.html
Created March 2, 2012 13:46 — forked from altnight/gist:454554
スカンディナヴィア半島
<!DOCTYPE html>
<html lang="ja">
<head>
<meta charset="UTF-8">
<title>スカンディナヴィア半島</title>
<link rel="stylesheet" href="./layout.css" type="text/css"></style>
</head>
<body>
<div id="header">
<!--
@podhmo
podhmo / cddr.rb
Created August 11, 2011 13:37 — forked from pasberth/cddr.rb
cddddddddr
class Array
def car
first
end
def cdr
clone.tap { |r| r.delete_at 0 }
end
def method_missing(name, *args)
@podhmo
podhmo / zizo.el
Created December 22, 2010 13:36 — forked from hitode909/zizo.el
(defun _zizo (begin end format)
(let ((str (buffer-substring-no-properties begin end))
(rules '((" " "+") ("|" "%7C") ("\n" "|") ("?" "%3F") ("&" "%26"))))
(loop for (pat rep) in rules
do (setq str (replace-regexp-in-string pat rep str)))
(browse-url (concat format str))))
(defun zizo (begin end &optional arg)
(interactive "r\nP")
(_zizo begin end "http://chart.apis.google.com/chart?chst=d_text_outline&chld=000000|12|l|_|_|"))