Skip to content

Instantly share code, notes, and snippets.

😇
Hello

Yoichi Fujimoto wozozo

😇
Hello
Block or report user

Report or block wozozo

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View __init__.py
from sqlalchemy import engine_from_config
from sqlalchemy.orm import sessionmaker
from sqlalchemy.orm import configure_mappers
import zope.sqlalchemy
# import or define all models here to ensure they are attached to the
# Base.metadata prior to any initialization routines
from .mymodel import MyModel # flake8: noqa
# run configure_mappers after defining all of the models to ensure
View __init__.py
from sqlalchemy import engine_from_config
from sqlalchemy.orm import sessionmaker
from sqlalchemy.orm import configure_mappers
import zope.sqlalchemy
# import or define all models here to ensure they are attached to the
# Base.metadata prior to any initialization routines
from .mymodel import MyModel # flake8: noqa
# run configure_mappers after defining all of the models to ensure
View gist:7ac3be0c0b651d4ddcd6d58e77c5b4ff
heso% ~ python -V
Python 2.7.10
heso% ~ which python
/usr/local/bin/python
heso% ~ pip install kytea
Collecting kytea
Using cached kytea-0.1.3.tar.gz
Building wheels for collected packages: kytea
View payjp.js
import Charge from './charge';
import Customer from './customer';
import Plan from './plan';
import Subscription from './subscription';
import Token from './token';
import Transfer from './transfer';
import Event from './event';
import Account from './account';
export default class Payjp {
View r.js
__DEV__=!1,__BUNDLE_START_TIME__=Date.now(),function(e){function t(e){for(var t,n,r,o,i=Array.prototype.slice.call(e),a={};i.length;)if(n=i.shift(),!a[n]&&(a[n]=!0,r=h[n],r&&r.waiting))for(t=0;t<r.dependencies.length;t++)o=r.dependencies[t],(!h[o]||h[o].waiting)&&i.push(o);for(n in a)y.call(a,n)&&i.push(n);var s=[];for(t=0;t<i.length;t++){n=i[t];var u=n;if(r=h[n])if(r.waiting){for(var c=[],l=0;l<r.dependencies.length;l++)o=r.dependencies[l],(!h[o]||h[o].waiting)&&c.push(o);u+=" is waiting for "+c.join(", ")}else u+=" is ready";else u+=" is not defined";s.push(u)}return s.join("\n")}function n(e){this.name="ModuleError",this.message=e,this.stack=Error(e).stack,this.framesToPop=2}function r(o){var i,a,s,u=h[o];if(u&&u.exports)return 1===u.refcount--&&delete h[o],u.exports;if(e.ErrorUtils&&!T){T=!0;try{var c=r.apply(this,arguments)}catch(d){e.ErrorUtils.reportFatalError(d)}return T=!1,c}if(!u)throw s='Requiring unknown module "'+o+'"',l&&(s+=". If you are sure the module is there, try restarting the packager."),
View gist:78e2258ccae18f3a0175

Vagrant の Postgresql に外部から接続

前提

  • CentOS

以下のファイルを編集

/var/lib/pgsql/9.4/data/pg_hba.conf

View init.coffee
fs = require('fs')
# Import ENV from zsh config.
fs.readFile process.env.HOME+"/.zshrc", "utf8", (err, zshFile) ->
envPaths = ['/usr/local/bin']
for l in zshFile.split('\n')
if l.substring(0,11) is 'export PATH'
e = l.split('=').splice(-1)[0]
e = e.replace(':$PATH','').replace(/"/g,'')
if ':' in e
View chimpoco.py
# coding: utf-8
import json
import requests
class Chimpo(object):
endpoint = 'http://chimpo.co/shortener/v1'
"""docstring for Chimpoco"""
View gist:37512b4cbb347816d179
FROM python:3.4.3-onbuild
RUN echo "mysql-server mysql-server/root_password password root" | debconf-set-selections && \
echo "mysql-server mysql-server/root_password_again password root" | debconf-set-selections && \
apt-get update && apt-get install -q -y \
mysql-client libmysqlclient-dev \
postgresql-client libpq-dev \
sqlite3 \
gcc \
mysql-server \
You can’t perform that action at this time.