Skip to content

Instantly share code, notes, and snippets.

@sanryuu
sanryuu / readme.md
Last active May 3, 2019 11:02
A4の日光企画用PDFへの隠しノンブル入れスクリプト。マジックナンバー多くてすみません。
@sanryuu
sanryuu / relaese.js
Created May 3, 2019 10:57
A4の日光企画用隠しノンブル入れスクリプト
// https://qiita.com/ukyo/items/4a0f697c332343d77659
#!/usr/bin/env node
const { execSync } = require("child_process");
const fs = require("fs");
// 環境に合わせて設定を変更する
// B5は WIDTH = 182; HEIGHT = 257;
const PAGE_START = 1;
;;; package ---
;;; Commentary:
;;; Code:
(require 'json)
(require 'qiita)
(require 'package)
(setq inhibit-startup-message t)
(package-initialize)
(setq qiita->token "c06d5534aaad880a45cd8c530098e7751cb2cabc")
@sanryuu
sanryuu / index.html
Created March 22, 2015 07:09
クリックすると画面が切り替わるCSSのサンプル
<html>
<head>
<link rel="stylesheet" href="sample.css">
</head>
<div class="background">
<div class="clicked">
</div>
</div>
</body>
@sanryuu
sanryuu / min.rb
Created February 25, 2015 01:53
CapybaraとSeleniumを使って少ないコードで実行を試す。
#! /usr/bin/env ruby
require "capybara"
require "selenium-webdriver"
session = Capybara::Session.new(:selenium)
session.visit 'http://example.com'
session.save_screenshot('screenshot.png')
import sys
sys.path.append('/usr/local/lib/python2.7/site-packages')
import cv2
import os
argv = sys.argv
#HAAR分類器の顔検出用の特徴量
#cascade_path = "/usr/local/Cellar/opencv/2.4.9/share/OpenCV/haarcascades/haarcascade_frontalface_default.xml"
p [[1,2],[3,4],[5,6]].flatten
# => [1, 2, 3, 4, 5, 6]
@sanryuu
sanryuu / file0.txt
Last active October 6, 2017 06:04
CapybaraとSeleniumを使ってGoogle検索するサンプルコード ref: http://qiita.com/sanryuu/items/5b1b4794f5fd3b26679c
#! /usr/bin/env ruby
require "capybara"
require "selenium-webdriver"
Capybara.current_driver = :selenium
module Crowler
class Google
include Capybara::DSL
@sanryuu
sanryuu / re-load-log.el
Created December 11, 2013 16:35
ログの最新版のみバッファに取得するメソッド
(setq file-size (make-hash-table :test #'equal))
(defun re-load-log (file-name)
(interactive)
(let (point-last-read regenesis)
(setq point-last-read (gethash file-name file-size))
(with-temp-buffer
(insert-file-contents file-name)
(when (> point-last-read (point-max))
(setq point-last-read (point-min)))
(when (not point-last-read)
@sanryuu
sanryuu / fill-in-template.el
Last active January 13, 2018 03:02
Emacsでテンプレートから文書を生成する。
;;
;; ---- how to use --------
;;
;; M-x fit:generate
;;
;; ---- setting templete and varibale --------
;;
;; (setq template-dir "~/template")
;;
;; (fit:register-template "経営会議" "management-meeting" fit:week-tuesday)