Skip to content

Instantly share code, notes, and snippets.

View klickreflex's full-sized avatar

Daniel Wentsch klickreflex

View GitHub Profile
// 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 / 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';
}
}
@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 / .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 / .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 / 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 / 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 / .htaccess
Last active May 17, 2021 14:10
Setting up and Using Environments with htaccess
# This `.htaccess` snippet does the following:
# 1. Create two environments called staging and development based on the host name
# 2. Set up ht authentication only on the stage server (`Deny from env=staging`)
# 3. Rewrite all requests to the main domain (www.mysite.com) if we’re not on either the development nor staging environment and the host doesn't already equal the main domain
AuthName "Staging Server"
AuthType Basic
AuthUserFile /var/sites/mysite/.htpasswd
AuthGroupFile /dev/null
@klickreflex
klickreflex / drupal_rule_disable_shipping_for_digital_products
Created September 5, 2014 09:50
Drupal: Disable Shipping pane and shipping address collection if order contains only products of certain type
{ "rules_disable_shipping_digital" : {
"LABEL" : "Disable Shipping for Digital Products",
"PLUGIN" : "reaction rule",
"OWNER" : "rules",
"REQUIRES" : [ "commerce_order", "commerce_rules_extra" ],
"ON" : { "process_checkout_pane" : [] },
"IF" : [
{ "NOT commerce_order_contains_product_type" : {
"commerce_order" : [ "commerce_order" ],
"product_type" : { "value" : { "physical_product" : "physical_product" } },
From ca58987b48dd563bb5f1743bcfed32da6b014c93 Mon Sep 17 00:00:00 2001
From: Daniel Wentsch <hello@wentsch.me>
Date: Mon, 18 Aug 2014 16:19:59 +0200
Subject: [PATCH] Added missing localization for File Downloads Suite default
values, fixed a typo
---
sites/all/modules/contrib/ms_files/ms_files.module | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)