Skip to content

Instantly share code, notes, and snippets.

Avatar
😇
Hello

Yoichi Fujimoto wozozo

😇
Hello
View GitHub Profile
View pyramid_renderer_flask.py
import json
from pyramid.renderers import JSON
class FlaskRenderer(JSON):
def __call__(self, info):
def _render(value, system):
request = system.get('request')
View gist:fc159575b082fbc9b596cf3b15f80325
/***** Fadding Entrances ******/
.flip-left {
-webkit-animation: flipLeft 1 1s ease-out;
-moz-animation: flipLeft 1 1s ease-out;
-ms-animation: flipLeft 1 1s ease-out;
-o-animation: flipLeft 1 1s ease-out;
animation: flipLeft 1 1s ease-out;
opacity: 1 !important;
visibility: visible !important;
}
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
You can’t perform that action at this time.