Skip to content

Instantly share code, notes, and snippets.

View deg84's full-sized avatar

DEGUCHI Tatsuya deg84

View GitHub Profile
@deg84
deg84 / init.lua
Last active April 9, 2017 14:15
Hammerspoon
local function keyCode(key, modifiers)
modifiers = modifiers or {}
return function()
hs.eventtap.event.newKeyEvent(modifiers, string.lower(key), true):post()
hs.timer.usleep(1000)
hs.eventtap.event.newKeyEvent(modifiers, string.lower(key), false):post()
end
end
local function remapKey(modifiers, key, keyCode)
@deg84
deg84 / gist:9743134
Last active August 29, 2015 13:57 — forked from kozy4324/ext_command.md
serverspecでユーザーを指定してコマンドを実行させる拡張

Commandクラスにby_userメソッドを追加する。

module Serverspec
  module Type
    class Command
      def by_user(user)
        self.class.new("su -l #{user.shellescape} -c #{@name.shellescape}")
      end
 end