This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fastcgi_param QUERY_STRING $query_string; | |
fastcgi_param REQUEST_METHOD $request_method; | |
fastcgi_param CONTENT_TYPE $content_type; | |
fastcgi_param CONTENT_LENGTH $content_length; | |
fastcgi_param SCRIPT_NAME $fastcgi_script_name; | |
fastcgi_param REQUEST_URI $request_uri; | |
fastcgi_param DOCUMENT_URI $document_uri; | |
fastcgi_param DOCUMENT_ROOT $document_root; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* eslint-disable require-jsdoc */ | |
const SOURCE_DIR = `${__dirname}/src/js` | |
const DEST_DIR = `${__dirname}/static` | |
console.log(SOURCE_DIR) | |
console.log(DEST_DIR) | |
module.exports = { | |
entry: { | |
main: ['babel-polyfill', `${SOURCE_DIR}/main.es6`], | |
}, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class RefCounter { | |
constructor() { | |
this.counter = 0 | |
this.decrementers = new WeakSet() | |
} | |
increment() { | |
this.counter += 1 | |
const decrementer = () => { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
set -e | |
source "$(git --exec-path)/git-sh-setup" | |
USAGE="<remote> <branch>" | |
function _remaster_pr() { | |
local readonly remote=$1 | |
local readonly branch=$2 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def on_message(self, *args): | |
print('{:.3f}: on_message'.format(elapsed_time())) | |
try: | |
message = self._socket.recv(nnpy.DONTWAIT) | |
print('{:.3f}: subscribe> {!r}'.format(elapsed_time(), message)) | |
except nnpy.NNError as exc: | |
if exc.error_no == nnpy.EAGAIN: | |
print('{:.3f}: subscribe> got EAGAIN. skip...'.format(elapsed_time())) | |
else: | |
raise |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(.env) warmonger:shn% python lstm_test.py test --saved-model ./epochs_1000/epochs/014/ (master@nico)-[.] | |
load words | |
112764 words | |
load the model | |
load the optimizer | |
やりと一家助や奇怪暴自行動臣を受けながら、やっぱり、それっき女の事にやってしまったにちがいないのです | |
彼の幻暴力理もなければ、こんなものですわ | |
大声あげるようですね?」 | |
僕たちの辺為に就いては僕と違うのです | |
浅田の霊濟まわりの奴リユの群節で、鳥へ演不文記にあきらめに珍野暮へ數を働住んでゐるのだ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import timeit | |
print 'pure sum', timeit.timeit('sum([1] * 10000)', number=100) | |
print 'numpy sum', timeit.timeit('numpy.sum([1] * 10000)', 'import numpy', number=100) | |
print 'pure sum', timeit.timeit('sum(x)', setup='x = [1] * 10000', number=100) | |
print 'numpy sum 1', timeit.timeit('numpy.sum(y)', 'import numpy; y = [1] * 10000', number=100) | |
print 'numpy sum 2', timeit.timeit('numpy.sum(z)', 'import numpy; z = numpy.array([1] * 10000)', number=100) | |
print 'numpy sum 3', timeit.timeit('numpy.sum(numpy.array(y))', 'import numpy; y = [1] * 10000', number=100) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*_ | |
from flask import Flask, url_for | |
def test(): | |
# Building test app. | |
app = Flask('test') | |
app.config['SERVER_NAME'] = 'localhost' | |
@app.route('/') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
S3_BUCKET=$1 | |
S3_OBJECT=$2 | |
S3CFG=S3-CONFIG-FILE | |
S3CMD="s3cmd -c $S3CFG" | |
TIMESTAMP=$((`date +%s` + 600)) | |
can_string="GET\n\n\n${TIMESTAMP}\n/${S3_BUCKET}/${S3_OBJECT}" | |
# generate the signature |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/local/bin/python3 | |
# -*- coding:utf-8 -*- | |
""" | |
iOS用の画像がどかっと渡された時に、いっぱつでImage.xcassetsを作ってくれるスクリプ | |
python3 yorosikuimage [画像のディレクトリ] [Image.xcassetsのパス] | |
""" | |
from PIL import Image | |
import os | |
import json |
NewerOlder