Skip to content

Instantly share code, notes, and snippets.

@jhilden
jhilden / .items
Last active August 29, 2015 13:59
openHAB zwave details danfoss living connect z
DateTime Date "Date [%1$tA, %1$td.%1$tm.%1$tY]" <calendar> { ntp="Europe/Berlin:de_DE" }
Group gZwaveNode04
String ZwaveNode04HomeID "Home ID [%s]" (gZwaveNode04) {zwave="4:1:command=info,item=home_id"}
Number ZwaveNode04NodeID "Node ID [%s]" (gZwaveNode04) {zwave="4:1:command=info,item=node_id"}
Number Thermostat_Battery "Thermostat Battery [%d %%]" {zwave="4:1:command=battery"}
@jhilden
jhilden / papertrail log
Created April 25, 2014 12:45
upload issue
Apr 25 14:21:33 makerist-production-srv-nng3w kernel: [566455.656190] nginx invoked oom-killer: gfp_mask=0x201da, order=0, oom_adj=0, oom_score_adj=0
Apr 25 14:21:33 makerist-production-srv-nng3w kernel: [566455.656195] nginx cpuset=/ mems_allowed=0
Apr 25 14:21:33 makerist-production-srv-nng3w kernel: [566455.656198] Pid: 23538, comm: nginx Not tainted 3.2.0-41-virtual #66-Ubuntu
Apr 25 14:21:33 makerist-production-srv-nng3w kernel: [566455.656200] Call Trace:
Apr 25 14:21:33 makerist-production-srv-nng3w kernel: [566455.656208] [<ffffffff81119721>] dump_header+0x91/0xe0
Apr 25 14:21:33 makerist-production-srv-nng3w kernel: [566455.656211] [<ffffffff81119aa5>] oom_kill_process+0x85/0xb0
Apr 25 14:21:33 makerist-production-srv-nng3w kernel: [566455.656213] [<ffffffff81119e4a>] out_of_memory+0xfa/0x220
Apr 25 14:21:33 makerist-production-srv-nng3w kernel: [566455.656216] [<ffffffff8111f833>] __alloc_pages_nodemask+0x8c3/0x8e0
Apr 25 14:21:33 makerist-production-srv-nng3w kernel: [566455.656221] [
@jhilden
jhilden / SassMeister-input-HTML.html
Created May 24, 2014 12:23
Generated by SassMeister.com.
<div class="m-box b-button-box">
<h3 class="m-box--header">button box</h3>
<div class="m-box--body">
<a class="m-button b-button-box--button">Button</a>
<a class="m-button as-small b-button-box--button">Small button</a>
<a class="m-button b-button-box--button">
<i class="m-button--icon">€</i>
Button with icon
</a>
</div>
@jhilden
jhilden / SassMeister-input-HTML.html
Created May 24, 2014 12:29
Generated by SassMeister.com.
<div class="m-box">
<h3 class="m-box--header">Some buttons</h3>
<div class="m-box--body">
<a class="m-button">Button</a>
<a class="m-button as-small">Small button</a>
<a class="m-button">
<i class="m-button--icon">€</i>
Button with icon
</a>
<a class="m-button is-disabled">
// -- datepicker --
// booking
$('#booking_start_date').datepicker({
onSelect: function(dateText, inst) {
$('#booking_end_date').datepicker("option", 'minDate', new Date(dateText));
},
beforeShowDay: disableUnavailableDays,
dateFormat: 'dd-mm-yy'
});
$('#booking_end_date').datepicker({
@jhilden
jhilden / input-placeholder_mixin.sass
Created April 16, 2011 08:43
A SASS mixin to set all the different (pseudo-) classes to style the color of placeholder text in e.g. an input field. What other styles besides color would be interesting?
@mixin input-placeholder($color)
&.placeholder
color: $color
&:-moz-placeholder
color: $color
&::-webkit-input-placeholder
color: $color
@jhilden
jhilden / yamltester.rb
Created May 26, 2011 13:31
YAML tester
require 'rubygems'
require 'yaml'
YAML::ENGINE.yamler = 'psych'
Dir["**/*.yml"].each do |file|
puts file
YAML.load_file file
end;0
@jhilden
jhilden / ruby_string_include_array.rb
Created August 30, 2011 16:02
[Ruby] String.include?([Array])
# I find myself constantly wanting to check whether one string is included within an array of strings.
# It is certainly possible (and also fast) to do that in Ruby with something like this: ["foo", "bar"].include?("foo")
# But I don't think it reads very nice :(
# Because what I actually want to test is, whether my string is included in the array and NOT the other way around.
# - Do you have the same problem?
# - What do you think about the following two solutions?
class String
# create a new method
@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, "") )
.icons-sprite
.icons-ad
.icons-add-small
.icons-add-tiny
.icons-ae
.icons-af
.icons-ag
.icons-ai
.icons-al
.icons-alert-error