Skip to content

Instantly share code, notes, and snippets.

@DarrylD
DarrylD / directive.js
Created February 14, 2015 22:02
ionic slide box dynamic height - fixes the issue where the slide boxes aren't taking up the full height of the device
app.directive('dynamicHeight', function() {
return {
require: ['^ionSlideBox'],
link: function(scope, elem, attrs, slider) {
scope.$watch(function() {
return slider[0].__slider.selected();
}, function(val) {
//getting the heigh of the container that has the height of the viewport
var newHeight = window.getComputedStyle(elem.parent()[0], null).getPropertyValue("height");
if (newHeight) {
@chriskoch
chriskoch / getter-setter-traits.php
Created February 13, 2013 10:47
Using PHP 5.4 traits as getter and setter helper
<?php
trait Getters
{
/**
* calls Class::$name()
*
* @param string $name the name of a requested property
* @return mixed the result
*/