This file contains 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
var client = require('cheerio-httpcli'); | |
var execSync = require('child_process').execSync; | |
client.fetch('http://attic.neophilia.co.jp/aozora/genjimonogatari/htmlfiles/kiritsubo.html', {}, (err, $, res) => { | |
$('p').each(function(idx) { | |
$(this)[0].children | |
.filter(item => item.type === 'text') | |
.map(item => item.data.replace(/(.+)/g, '')) | |
.forEach(item => execSync(`say ${item}`)); | |
}); |
This file contains 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 | |
npm install && \ | |
npm run docs && \ | |
git checkout gh-pages && \ | |
rm -rf classes interfaces assets index.html && \ | |
mv ./docs/* . && \ | |
rmdir docs && \ | |
git add . && \ | |
git commit -m "build $(git describe --abbrev=0 master) document : $(date)" && \ |
This file contains 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
language: php | |
php: | |
- '5.4' | |
- '5.5' | |
- '5.6' | |
- '7.0' | |
- hhvm |
This file contains 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 | |
brew install --with-cocoa --srgb --with-gnutls emacs | |
brew linkapps emacs |
This file contains 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
"" |> IO.gets |> String.trim_trailing |> String.split(" ") |> Enum.map(&String.to_integer(&1)) |
This file contains 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
function createPyramid(height){ | |
return Array.from({length: height}, (v,k) => k+1) | |
.map(r => ' '.repeat(height-r).concat('*'.repeat(r*2-1))) | |
.join('\n'); | |
} | |
console.log(createPyramid(10)); |
This file contains 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
// client/node/server.js | |
// https://github.com/shakacode/react_on_rails/blob/master/docs/additional-reading/node-server-rendering.md | |
var net = require('net'); | |
var fs = require('fs'); | |
var bundlePath = '../../app/assets/webpack/'; | |
var bundleFileName = 'webpack-bundle.js'; | |
var currentArg; |
This file contains 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
use IO::Socket::UNIX; | |
use JSON; | |
my $SOCK_PATH = "./node.sock"; | |
print $SOCK_PATH; | |
my $client = IO::Socket::UNIX->new( | |
Type => SOCK_STREAM(), | |
Peer => $SOCK_PATH, | |
) or die $!; |
This file contains 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
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8" /> | |
<%= server_render_js("Helmet.rewind().title.toString()") %> | |
<%= csrf_meta_tags %> | |
<%= stylesheet_link_tag 'application', media: 'all' %> | |
</head> | |
<body> | |
<%= yield %> |
This file contains 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 React from 'react'; | |
import { Provider } from 'react-redux'; | |
import { match, RouterContext } from 'react-router'; | |
import ReactOnRails from 'react-on-rails'; | |
import Helmet from 'react-helmet'; | |
import routes from '../routes/routes'; | |
import store from '../store/store'; | |
// for header title server side rendeting on first load | |
// ref: http://r7kamura.hatenablog.com/entry/2016/10/10/173610 |