Skip to content

Instantly share code, notes, and snippets.

View ykzts's full-sized avatar
💛
Inaba Haneru Love

Yamagishi Kazutoshi ykzts

💛
Inaba Haneru Love
View GitHub Profile
@ykzts
ykzts / erlang.rst
Last active September 21, 2016 12:25 — forked from voluntas/erlang.rst
Erlang/OTP (仮)

Erlang/OTP (仮)

日時:2016-06-24
作:@voluntas
バージョン:0.0.0
url:https://voluntas.github.io/

2016 年 6 月 24 日に行われる BPStudy の発表資料です

/**
* @original https://assets-cdn.github.com/assets/frameworks-88471af1fec40ff9418efbe2ddd15b6896af8d772f8179004c254dffc25ea490.js
*/
(function(e) {
function t(e, t) {
var r = e.getContext("2d");
return n(r, t),
0 !== r.getImageData(16, 16, 1, 1).data[0]
}
function n(e, t) {
function _asyncToGenerator(fn) {
return function () {
var gen = fn.apply(this, arguments);
return new Promise(function (resolve, reject) {
function step(key, arg) {
try {
var info = gen[key](arg);
var value = info.value;
} catch (error) {
reject(error);
user: www-data
max-connections: 10240
server-name: h2o
access-log: "| rotatelogs /var/log/h2o/access.log.%Y%m%d 86400"
error-log: "| rotatelogs /var/log/h2o/error.log.%Y%m%d 86400"
proxy.preserve-x-forwarded-proto: ON
hosts:
"example.com:80":
listen:
port: 80
@ykzts
ykzts / del-tw.js
Last active August 30, 2016 01:43
const csv = require('csv');
const fs = require('fs');
const Twitter = require('twitter');
const maxId = null;
const client = new Twitter({
consumer_key: '',
consumer_secret: '',
access_token_key: '',
@ykzts
ykzts / bookmarklet.txt
Last active August 13, 2016 16:01
`video` 要素を PNG 形式にして名前をつけて保存する便利なブックマークレット
javascript:(function(v%2Ce%2Ca%2Cc)%7Be.width%3Dv.videoWidth%3Be.height%3Dv.videoHeight%3Bc%3De.getContext('2d')%3Bc.drawImage(v%2C0%2C0)%3Be.toBlob(function(b)%7Ba.href%3DURL.createObjectURL(b)%3Ba.download%3DDate.now()%2B'.png'%3Ba.click()%7D%2C'image%2Fpng')%7D)(document.querySelector('video')%2Cdocument.createElement('canvas')%2Cdocument.createElement('a'))
[Unit]
Description=H2O - the optimized HTTP/1, HTTP/2 server
After=syslog.target network.target
[Service]
ExecStart=/usr/local/bin/h2o -c /etc/h2o/h2o.conf
ExecStop=/bin/kill -TERM $MAINPID
ExecReload=/bin/kill -HUP $MAINPID
KillMode=process
Restart=always
function open(blob) {
return new Promise(function(resolve, reject) {
var fileReader = new FileReader();
fileReader.addEventListener('load', function() {
resolve(this.result);
});
fileReader.addEventListener('error', function() {
reject(this.error);
});
fileReader.readAsText(blob);
# /etc/nginx/conf.d/default.conf
server {
listen 80 default_server;
error_page 404 @404;
location = / {
default_type text/plain;
return 200 "...\n";
import React, { Component, PropTypes } from 'react';
export default function provideContext(contextTypes) {
return function(ComposedComponent) {
return class ContextProvider extends Component {
static displayName = `ContextProvider(${ComposedComponent.displayName})`;
static childContextTypes = Object.assign({}, contextTypes || {});
static propTypes = {