Skip to content

Instantly share code, notes, and snippets.

@seventhsense
seventhsense / docx2md.sh
Last active July 18, 2018 21:07
docxをmarkdownにまとめて変換するスクリプト(要pandoc)
#!/bin/bash
# 同一ディレクトリ上のdocxファイルをmdファイルに変換する.元ファイルは残る.
# refer https://qiita.com/kinagaki/items/460577f46529484d720e
dir=`pwd`
list=`find ${dir} -type f`
for file in $list; do
filename=`basename $file`
@seventhsense
seventhsense / transform_filename.sh
Created July 18, 2018 21:00
日本語ファイル名のmdをローマ字でハイフン分かち書きに変換するスクリプト(破壊的)要nkf kakasi
#!/bin/bash
dir=`pwd`
list=`find ${dir} -type f`
for file in $list; do
filename=`basename $file`
ext=${filename##*.}
if [[ $ext == "md" ]]; then
echo $filename
@seventhsense
seventhsense / add_front_matter.sh
Created July 16, 2018 13:48
add front matter for jekyll
#!/bin/bash
dir=`pwd`
list=`find ${dir} -type f`
LF=$(printf '\\\012_')
LF=${LF%_}
for file in $list; do
filename=`basename $file`
test:
adapter: mysql2
database: my_app_test
username: root
encoding: utf8
cucumber:
adapter: mysql2
database: my_app_test
username: root
encoding: utf8
# Additional translations at https://github.com/plataformatec/devise/wiki/I18n
ja:
devise:
confirmations:
confirmed: "アカウントが確認されました。ログインしています。"
send_instructions: "アカウントの確認方法を数分以内にメールでご連絡します。"
send_paranoid_instructions: "ご登録のメールアドレスが保存されている場合、アカウントの確認方法をメールでご連絡します。"
failure:
already_authenticated: "既にログインしています。"
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""a stock order via SBI Securities.
"order_sbisec.py" is released under the MIT License
Copyright (c) 2017 Akihiro Yamamoto
__author__ = "Akihiro Yamamoto <ak1211@mail.ak1211.com>"
__version__ = "0.5.2"
__date__ = "Oct 2017"
@seventhsense
seventhsense / application.coffee
Last active February 21, 2016 09:39
for electron development
class MyApp.Application extends Backbone.Marionette.Application
$(document).ready ->
app = new MyApp.Application
app.start()
@seventhsense
seventhsense / FadeTransitionRegion.js
Created January 30, 2016 15:16 — forked from brian-mann/FadeTransitionRegion.js
Allows jQuery animation transitions between marionette regions
var FadeTransitionRegion = Backbone.Marionette.Region.extend({
show: function(view){
this.ensureEl();
view.render();
this.close(function() {
if (this.currentView && this.currentView !== view) { return; }
this.currentView = view;

https://github.com/mojombo/jekyll/wiki/Plugins

Jekyllプラグインシステムのフックは、あなたのサイト向けに特化したコンテンツの生成を可能にします。Jekyllのソースを修正することなく、あなたのサイト用のコードを実行できます。

The Jekyll plugin system hooks allow you to create custom generated content specific to your site. You can run custom code for your site without having to modify the Jekyll source itself.

プラグインのインストール

h2. Installing a plugin

def ping(ip)
r = Regexp.new('[1-9]\d* (packets )?received')
result = r.match(`ping -c 1 -W 1 #{ip}`)
result != nil
end
def arp(ip)
r = Regexp.new('[0-f]+:[0-f]+:[0-f]+:[0-f]+:[0-f]+:[0-f]+')
result = r.match(`arp -n #{ip}`)
result ? result.to_s : nil