Skip to content

Instantly share code, notes, and snippets.

View vlad-shatskyi's full-sized avatar

Volodymyr Shatskyi vlad-shatskyi

View GitHub Profile
@vlad-shatskyi
vlad-shatskyi / notifyosd.zsh
Last active December 15, 2015 11:49 — forked from ihashacks/notifyosd.zsh
Displays a notification when a command, that takes over 10 seconds to execute, finishes and only if the current window isn't the terminal. Add to your .zshrc: [ -e path/to/notifyosd.zsh ] && . path/to/notifyosd.zsh
function active-window-id {
echo `xprop -root | awk '/_NET_ACTIVE_WINDOW\(WINDOW\)/{print $NF}'`
}
# end and compare timer, notify-send if needed
function notifyosd-precmd() {
if [ ! -z "$cmd" ]; then
cmd_end=`date +%s`
((cmd_time=$cmd_end - $cmd_start))
fi
user = User.find(1)
site = Site.new
site.url = "http://www.google.com"
site.name = "Google"
user.sites << site
if user.save
'cool'
File.foreach( "dictionary.txt" ) do |line|
md = line.match(/\A([A-Z]+)/)
puts md[0] if md
end
<table style="float: left; margin-left: 20px;">
<% if @user == current_user %>
<caption>My Holidays</caption>
<thead>
<tr>
<th>Start Date</th>
<th>End Date</th>
<th>Description</th>
<th>State</th>
<th>Type</th>
<li>
<%= ('a'.ord + answer_counter).chr >) <%= answer.content %>
</li>