Skip to content

Instantly share code, notes, and snippets.

View kilaulena's full-sized avatar

Lena Herrmann kilaulena

  • Zalando Marketing Services
  • Berlin, Germany
  • X @kilaulena
View GitHub Profile
@kilaulena
kilaulena / stats.sh
Last active December 13, 2015 18:38
#!/bin/bash
# Tells you how your photos are distributed over the year - in which months do you take the most photos?
#
# call with
# ./stats.sh 2>/dev/null
# because there will be some broken exif data
date
echo "Total photos:"
@mislav
mislav / fat-logfiles.sh
Last active December 22, 2018 19:56
Find "*.log" files in your home dir, sort them by fattest-first, and calculate the size of them all together.
find ~ -name '*.log' -print0 | xargs -0 -L1 stat -f'%z %N' | sort -rn | tee fat-logfiles.txt | head
awk '{ total += $1 } END { printf "total: %5.2f MiB\n", total/1024/1024 }' < fat-logfiles.txt
@jhilden
jhilden / tabs.js.coffee
Created August 28, 2012 10:33
Remove jquery-ui styling for tabs
$ ->
jquery_ui_classes = [".ui-tabs", ".ui-tabs-nav", ".ui-tabs-panel", ".ui-widget", ".ui-widget-header", ".ui-widget-content", ".ui-corner-all", ".ui-corner-top", ".ui-corner-bottom", ".ui-helper-clearfix", ".ui-helper-reset", ".ui-state-default"]
$(".js-tabs").tabs().each ->
# removes all the jquery-ui specific classes (except ones like ui-state-active)
$elements = $(this).find( jquery_ui_classes.join(", ") ).andSelf()
$elements.removeClass( jquery_ui_classes.join(" ").replace(/\./g, "") )
@kilaulena
kilaulena / js_steps.rb
Created July 7, 2011 22:10
test capybara visibility
Then /^"([^\"]+)" should be visible$/ do |text|
assert page.has_xpath?("//*[not(descendant-or-self::script)][ancestor::*[contains(@style,'display: none;')]][contains(normalize-space(.),'#{text}')]")
end
Then /^"([^\"]+)" should not be visible$/ do |text|
assert page.has_xpath?("//*[not(descendant-or-self::script)][ancestor::*[contains(@style,'display: none;')]][contains(normalize-space(.),'#{text}')]")
end