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
Pry.config.prompt = proc do |obj, nest_level, _pry_| | |
db = '' | |
if defined? Rails | |
db << '%s:%s/%s' % Rails.configuration.database_configuration[Rails.env].values_at('host', 'port', 'database') | |
end | |
"#{Pry.config.prompt_name}(#{Pry.view_clip(obj)}) #{db}> " | |
end |
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
;; -*- mode: emacs-lisp -*- | |
;; This file is loaded by Spacemacs at startup. | |
;; It must be stored in your home directory. | |
(defun dotspacemacs/layers () | |
"Configuration Layers declaration. | |
You should not put any user code in this function besides modifying the variable | |
values." | |
(setq-default | |
;; Base distribution to use. This is a layer contained in the directory |
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
--- | |
- hosts: all | |
vars: | |
param1: 111 | |
tasks: | |
- fail: msg="{{ item }} is not defined" | |
when: "{{ item }} is not defined" | |
with_items: | |
- param1 | |
- param2 |
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
[Unit] | |
Description=Git hosting service | |
[Service] | |
User=gitbucket | |
ExecStart=/usr/bin/java -jar /home/gitbucket/gitbucket.war --port=xxxx --host=127.0.0.1 --gitbucket.home=/home/gitbucket/repo | |
[Install] | |
WantedBy=multi-user.target |
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
bind -x '"\C-_":cd $(ghq list -p | peco)' # プロジェクトディレクトリへcd | |
bind -x '"\C-]":open $(ghq list -p | peco)' # プロジェクトディレクトリをFinder上でopen | |
# Macのファイルオープン・セーブダイアログでも使えると良いんだけどなー。Cmd + Shift + g で代用。 | |
bind -x '"\C-^":ghq list -p | peco | xargs echo -n | pbcopy' |
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
<link rel="import" href="../ace-element/ace-element.html"> | |
<link rel="import" href="../chart-js/chart-js.html"> | |
<link rel="import" href="../core-icon-button/core-icon-button.html"> | |
<link rel="import" href="../core-menu/core-submenu.html"> | |
<link rel="import" href="../core-item/core-item.html"> | |
<polymer-element name="my-element"> | |
<template> | |
<style> |
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
#```ruby | |
require 'axlsx' | |
p = Axlsx::Package.new | |
wb = p.workbook | |
header = {:different_odd_ => false, :odd_header => "&L&F : &A&C&Pof&N&R&D &T"} | |
wb.add_worksheet(:name => "repeated header", :header_footer => header) do |sheet| | |
sheet.add_row %w(These Column Header Will Render On Every Printed Sheet) | |
200.times { sheet.add_row %w(1 2 3 4 5 6 7 8) } |
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
;;; Commentary | |
;; Select and activate google chrome tabs by anything interface | |
;;; Requirements | |
;; https://github.com/mechairoi/crxel | |
;;; Usage | |
;; (require 'anything-chrome-tabs) | |
;; (crxel/start 9649) | |
;; (define-key global-map "C-t" 'anything-chrome-tabs) | |
(provide 'anything-chrome-tabs) |
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
class TrueClass | |
def if_true_if_false(true_block, flase_block) | |
true_block.call | |
end | |
end | |
class FalseClass | |
def if_true_if_false(true_block, false_block) | |
false_block.call | |
end |
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
class String | |
def w3m | |
IO.popen("w3m -F -T text/html -dump", "w") do |w3m| | |
w3m.puts self | |
end | |
end | |
end |
NewerOlder