Skip to content

Instantly share code, notes, and snippets.

[aaaaaaa](https://localhost:8443/fashionwalker.html?page-to-buy=true)
CREATE EXTERNAL TABLE IF NOT EXISTS cloudfront_logs (
request_date STRING,
request_time STRING,
x_edge_location STRING,
sc_bytes INT,
client_ip STRING,
cs_method STRING,
cs_host STRING,
cs_uri_stem STRING,
sc_status STRING,
const patterns = [];
function preparePermutationRecursively({ values, arr, depth = 0, maxDepth }) {
if (depth >= maxDepth) {
patterns.push(arr);
return;
}
for (let i = 0; i < values.length; i ++) {
preparePermutationRecursively({
values,
@takayukii
takayukii / gist:5dc02608a2e650c036f76d2dbc15f908
Last active July 13, 2017 09:38
Avoid certificate errors when using Chromy
const Chromy = require('chromy');
async function main() {
const chromy = new Chromy({
visible: false,
// '--ignore-certificate-errors' not working when visible = false
chromeFlags: ['--proxy-server=127.0.0.1:8081', '--ignore-certificate-errors']
});
await chromy.blockUrls(['*.png', '*.jpg', '*.jpeg', '*.gif']);
@takayukii
takayukii / app-epics.js
Last active May 6, 2017 13:45
Eample of redux-observable: define separated epics to coordinate actions
import Rx from 'rxjs';
import {combineEpics} from 'redux-observable';
import {startLoading, endLoading, displayFlashErrorMessage} from '../actions/app-actions';
const debug = require('debug')('some-app:epics:app-epics');
const startLoadingEpic = (action$) =>
action$
.filter(action => /.+REQUEST$/.test(action.type))
@takayukii
takayukii / gist:4ce82227cc61accb3ef1e692e846a3f4
Created March 22, 2017 01:57
GraphQL Subscription sample
// npm install graphql graphql-tools graphql-subscriptions
const graphql = require('graphql');
const tools = require('graphql-tools');
const {PubSub, SubscriptionManager} = require('graphql-subscriptions');
const companies = [
{
id: 1,
name: 'A company'
@takayukii
takayukii / gist:12d1132eeb06112ab776e644c85325db
Created March 22, 2017 01:57
GraphQL Subscription sample
// npm install graphql graphql-tools graphql-subscriptions
const graphql = require('graphql');
const tools = require('graphql-tools');
const {PubSub, SubscriptionManager} = require('graphql-subscriptions');
const companies = [
{
id: 1,
name: 'A company'
@takayukii
takayukii / gist:a3c64ceb205d940cb7100d3e10c955c9
Last active March 22, 2017 00:08
GraphQL simple sample
const graphql = require('graphql');
const tools = require('graphql-tools');
const companies = [
{
id: 1,
name: 'A company'
},
{
id: 2,
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"iam:CreateVirtualMFADevice",
"iam:EnableMFADevice",
"iam:ResyncMFADevice",
"iam:DeleteVirtualMFADevice"
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Deny",
"Action": [
"ec2:*"
],
"Resource": [
"arn:aws:ec2:ap-northeast-1::instance/i-003c6a05a4978046a",