Skip to content

Instantly share code, notes, and snippets.

View shomah4a's full-sized avatar

shoma shomah4a

  • 10:27 (UTC +09:00)
View GitHub Profile
import socket
import mock
@mock.mock(socket)
def gethostname():
return 10
@gethostname
@shomah4a
shomah4a / functiontest.cpp
Created June 25, 2011 15:34
const つけた
#include <iostream>
#include <boost/function.hpp>
class Test
{
public:
explicit Test(const int x): v(x)
{}
@shomah4a
shomah4a / rss.scala
Created June 26, 2011 14:49
rss 読んでみた
import scala.io
import scala.xml
import scala.xml.parsing
import scala.xml.parsing.NoBindingFactoryAdapter
import nu.validator.htmlparser
import org.xml.sax
/// HTML からノードに変換
@shomah4a
shomah4a / test.cpp
Created July 18, 2011 15:21
extern とか
-----------------
ext.cpp
-----------------
#include <iostream>
#include "ext.h"
// 実態
int x = 10;
int main(int argc, char* args[])
@shomah4a
shomah4a / setup.py
Created July 25, 2011 03:31
PyPy 用 setup.py 書いてみた
#-*- coding:utf-8 -*-
# setup.py for pypy repository
import setuptools
import os
version = '1.5.0'
root = os.path.dirname(__file__)
@shomah4a
shomah4a / buildout.cfg
Created September 12, 2011 00:16
よく使う buildout.cfg のてんぷら
[buildout]
parts = env entry ipython sphinx nose pylint
modname = mymodule
develop =
.
[env]
recipe = zc.recipe.egg
@shomah4a
shomah4a / test.py
Created September 24, 2011 03:49
exec?
import traceback
source = '''
def self():
def test():
assert False
test()
@shomah4a
shomah4a / test.scala
Created November 3, 2011 03:38
なんとなくこんなことしてた
class Request()
{
}
class Response()
{
}
@shomah4a
shomah4a / lock.py
Created November 18, 2011 02:04
lock decorator
#-*- coding:utf-8 -*-
try:
import threading
except ImportError:
import dummy_threading as threading
LOCK_OBJECT = threading.RLock()
@shomah4a
shomah4a / slideshare.html
Created November 19, 2011 03:15
こんなの
<div style="width:425px" id="__ss_10114795"> <strong style="display:block;margin:12px 0 4px"><a href="http://www.slideshare.net/ShomaHosaka/pypy-10114795" title="PyPy 紹介" target="_blank">PyPy 紹介</a></strong> <iframe src="http://www.slideshare.net/slideshow/embed_code/10114795" width="425" height="355" frameborder="0" marginwidth="0" marginheight="0" scrolling="no"></iframe> <div style="padding:5px 0 12px"> View more <a href="http://www.slideshare.net/" target="_blank">presentations</a> from <a href="http://www.slideshare.net/ShomaHosaka" target="_blank">shoma </a> </div> </div>