Skip to content

Instantly share code, notes, and snippets.

View clauswitt's full-sized avatar

Claus Witt clauswitt

View GitHub Profile
{
"id": "deploy",
"comment": "Deploy User",
"groups": ["sysadmin","devops","developers"],
"email": "email of user",
"shell": "\/bin\/zsh",
"home": "\/home\/deploy",
"ssh_keys": ["public ssh key"],
"ssh_keygen": false,
"dotfiles": "https://github.com/username/dotfiles.git"
include_recipe "git"
search( :users, "dotfiles:*" ).each do |u|
user_id = u["id"]
directory "/home/#{user_id}/bin" do
owner user_id
group user_id
mode "0755"
action :create
end
name "base"
description "base role"
run_list [
"recipe[chef-solo-search]",
"recipe[apt]",
"recipe[apt-update]",
"recipe[ntp]",
"recipe[git]",
"recipe[zsh]",
"recipe[tmux]",
newpost() {
middleman article $1
vim `gsts |awk '{print \$2}'`
}
tell application "iTerm"
set myterm to (make new terminal)
tell myterm
set mysession to (make new session at the end of sessions)
tell mysession
set name to "Blog"
exec command "/usr/local/bin/zsh"
end tell
tell the last session
write text "mux blogs"
" Search Dash for word under cursor
function! SearchDash()
let s:browser = "/usr/bin/open"
let s:wordUnderCursor = expand("<cword>")
let s:currentFileType = &filetype
let s:url = "dash://".s:currentFileType.":".s:wordUnderCursor
let s:cmd ="silent ! " . s:browser . " " . s:url
execute s:cmd
redraw!
endfunction
tell application "Concentrate"
if concentrating then
stop concentrating
else
tell activity "{query}"
concentrate
end tell
end if
end tell
xml = items.select {|item| item[:title].downcase.start_with?(ARGV[0].downcase) }.map { |item| "<item uid=\"activity\" arg=\"#{item[:title]}\"><title>#{item[:title]}</title><subtitle>Concentrate on #{item[:title]}</subtitle><icon>icon.png</icon></item>"}.join('')
puts "<items>#{xml}</items>"
items = `osascript ./list.scpt`.gsub(/activity /, '').gsub(/\n/, '').split(/. /).map { |item| {:title => item.to_s }}
tell application "Concentrate"
every activity
end tell