Skip to content

Instantly share code, notes, and snippets.

View klickreflex's full-sized avatar

Daniel Wentsch klickreflex

View GitHub Profile
@klickreflex
klickreflex / ResponsiveStickyFooter
Created September 19, 2014 15:06
Responsive Sticky Footer
/* Responsive Sticky Footer (http://galengidman.com/2014/03/25/responsive-flexible-height-sticky-footers-in-css/) */
html,
body { height: 100%; }
body {
display: table;
width: 100%;
}
.page-row {
display: table-row;
@klickreflex
klickreflex / facebook_canvas
Last active August 29, 2015 14:10
Simple Facebook Canvas with Page Tab
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Donations</title>
</head>
<body>
<script>
window.fbAsyncInit = function() {
FB.init({
@klickreflex
klickreflex / .vimrc
Last active November 10, 2015 11:16
my vimrc
set nocompatible " be iMproved, required
filetype off " required
" highlighting
set relativenumber
syntax on
set background=dark
set cursorline
" tabbing
@klickreflex
klickreflex / .zshrc
Last active November 10, 2015 11:17
my .zshrc
# Path to your oh-my-zsh installation.
export ZSH=/Users/wentsch/.oh-my-zsh
# Set name of the theme to load.
# Look in ~/.oh-my-zsh/themes/
# Optionally, if you set this to "random", it'll load a random theme each
# time that oh-my-zsh is loaded.
ZSH_THEME="avit"
# Uncomment the following line to use case-sensitive completion.
@klickreflex
klickreflex / gist:5f62feca0eb0367e5440
Created November 10, 2015 11:20
Afterglow iTerm2 color theme
[General]
Description=Afterglow
Opacity=1
Wallpaper=
[Background]
Color=34,34,34
[BackgroundIntense]
Color=34,34,34
@klickreflex
klickreflex / template.php
Created June 2, 2016 12:34
Drupal: Add Body Class when Tabs are displayed
<?php
function THEMENAME_preprocess_html(&$vars, $hook) {
// Make tabs available on html tpl
$vars['tabs'] = menu_local_tabs();
// if we have primary tabs, add an accoring body class
if (!empty($vars['tabs']['#primary'])) {
$vars['classes_array'][] = 'has-tabs';
}
}
// Get Breakpoints from CSS and store in `breakpoint` object
var breakpoint = {};
breakpoint.refreshValue = function () {
this.value = window.getComputedStyle(document.querySelector('head'), ':before').getPropertyValue('content').replace(/\"/g, '');
};
// Put it inside a function
var currentBreakFn = function() {
breakpoint.refreshValue();
};
@klickreflex
klickreflex / .htaccess
Created July 4, 2016 11:59
gzip text with apache
AddType image/svg+xml .svg
AddOutputFilterByType DEFLATE image/svg+xml text/html text/xml text/css text/javascript
@klickreflex
klickreflex / si_formatters.module.php
Last active July 27, 2016 11:27
Drupal Commerce: Add to Cart OR Download Formatter, https://www.drupal.org/node/2660424
<?php
/**
* @file
* adds a formatter for commerce file fields that shows an add to cart button OR
* a file download link, depending on whether the current user has a license for the file
*
*/
/**
* Implements hook_field_formatter_info().
@klickreflex
klickreflex / _flexboxgrid.scss
Created April 11, 2017 12:13
Flexboxgrid Sass-Port with Helper classes
// Flexbox Grid Sass Adpatation, forked ot remove external dependency
// Source: https://github.com/klickreflex/flexboxgrid-sass
// Set the number of columns you want to use on your layout.
$grid-columns: 12 !default;
// Set the gutter between columns.
$gutter-width: 1rem !default;
// Set a margin for the container sides.
$outer-margin: 2rem !default;
// Create or remove breakpoints for your project