Skip to content

Instantly share code, notes, and snippets.

Avatar
🐧
Translating

cocoatomo cocoatomo

🐧
Translating
View GitHub Profile
View gist:4966725
Downloading/unpacking Jinja2>=2.3 (from sphinx)
Downloading Jinja2-2.6.tar.gz (389kB): 389kB downloaded
Exception in thread Thread-4:
Traceback (most recent call last):
File "/usr/local/Cellar/python3/3.3.0/Frameworks/Python.framework/Versions/3.3/lib/python3.3/threading.py", line 639, in _bootstrap_inner
self.run()
File "/usr/local/Cellar/python3/3.3.0/Frameworks/Python.framework/Versions/3.3/lib/python3.3/threading.py", line 596, in run
self._target(*self._args, **self._kwargs)
File "/Users/<user>/.virtualenvs/sphinx3/lib/python3.3/site-packages/pip-1.2.1-py3.3.egg/pip/index.py", line 245, in _get_queued_page
page = self._get_page(location, req)
@cocoatomo
cocoatomo / Hoge.py
Last active Dec 10, 2015 — forked from irof/Hoge.java
use Jython
View Hoge.py
#!/usr/bin/env jython
# -*- coding: utf-8 -*-
class Fuga(object):
def __init__(self, color, weight):
self.color = color
self.weight = weight
@cocoatomo
cocoatomo / Hoge.java
Last active Dec 10, 2015 — forked from irof/Hoge.java
using Guava
View Hoge.java
package net.elliptium;
import java.util.ArrayList;
import java.util.Collection;
import java.util.List;
import com.google.common.base.Function;
import com.google.common.base.Predicate;
import com.google.common.collect.Collections2;
View gist:2901287
$ pwd
/tmp/module
$ tree
.
├── __init__.py
├── fluent
│   ├── __init__.py
│   └── sender.py
└── fluent.py
View noinit.py
class Hoge():
def __init__(self):
def disabled_init(self):
raise NotImplementedError('__init__ disabled')
Hoge.__init__ = disabled_init
if __name__ == '__main__':
print 'h = Hoge()'
h = Hoge()
print 'h2 = Hoge()'
View cloudera-cdh.repo
[cloudera-cdh3u0]
name=Cloudera's Distribution for Hadoop, Version 3 update 0
mirrorlist=http://archive.cloudera.com/redhat/cdh/3u0/mirrors
gpgkey = http://archive.cloudera.com/redhat/cdh/RPM-GPG-KEY-cloudera
gpgcheck = 0
[cloudera-cdh3u1]
name=Cloudera's Distribution for Hadoop, Version 3 update 1
mirrorlist=http://archive.cloudera.com/redhat/cdh/3u1/mirrors
gpgkey = http://archive.cloudera.com/redhat/cdh/RPM-GPG-KEY-cloudera
@cocoatomo
cocoatomo / gist:2396838
Created Apr 16, 2012
改行制御のテスト
View gist:2396838

test

aaa
改行
されない!?
こっちはどうだろ?
改行制御
View globals.py
def _lookup_object(name):
top = _request_ctx_stack.top
if top is None:
raise RuntimeError('working outside of request context')
return getattr(top, name)
View gist:2310864
127.0.0.1 - - [05/Apr/2012 21:54:14] "GET /download HTTP/1.1" 500 -
Traceback (most recent call last):
File "/Users/kinebuchi/.virtualenvs/worktime/lib/python2.7/site-packages/flask/app.py", line 1518, in __call__
return self.wsgi_app(environ, start_response)
File "/Users/kinebuchi/.virtualenvs/worktime/lib/python2.7/site-packages/flask/app.py", line 1506, in wsgi_app
response = self.make_response(self.handle_exception(e))
File "/Users/kinebuchi/.virtualenvs/worktime/lib/python2.7/site-packages/flask/app.py", line 1504, in wsgi_app
response = self.full_dispatch_request()
File "/Users/kinebuchi/.virtualenvs/worktime/lib/python2.7/site-packages/flask/app.py", line 1264, in full_dispatch_request
rv = self.handle_user_exception(e)
View app.py
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from flask import Flask, render_template, make_response
from model import app, db, WorkTime, Employee, Project
import csv
def create_csv():