Skip to content

Instantly share code, notes, and snippets.

Avatar

Daniel Wentsch klickreflex

View GitHub Profile
@klickreflex
klickreflex / index.html
Created Jun 11, 2021
Lined Textarea with Tailwind
View index.html
<div class="p-8">
<div class="border border-gray-200 rounded-sm px-4 py-2 focus-within:border-blue-400">
<label class="text-sm text-gray-400 block uppercase tracking-wide font-bold"> Label </label>
<textarea class="text-gray-700 leading-[28px] min-h-[96px] bg-gray-lines bg-local w-full focus:outline-none">Congue aptent sagittis sollicitudin bibendum arcu orci euismod nibh pellentesque vulputate eget aliquam praesent, pretium primis rhoncus curae urna lectus tempus mauris proin montes ligula eu.</textarea>
</div>
</div>
@klickreflex
klickreflex / convert_m4b.sh
Created Mar 15, 2021 — forked from nitrag/convert_m4b.sh
Audibook convert m4b to mp3. This will split into chaptered mp3 files and automatically reconfigure proper ID3v2 tags. (adjusted to work on MacOS)
View convert_m4b.sh
#!/bin/bash
#
# brew install id3v2 ffmpeg
#
# USAGE:
# cd /book title/
# bash ~/this_script_path.sh
# rm *.m4b (you need to manually remove the original in case something goes wrong)
#
#
@klickreflex
klickreflex / import.rb
Last active Jun 4, 2020
Import Instagram Export to Day One Journal (requires the Day One CLI tool)
View import.rb
require 'json'
file = File.read('media.json')
data_hash = JSON.parse(file)
photos = data_hash['photos']
i = 0
photos.each do |key, value|
date = key['taken_at']
path = key['path']
View keybase.md

Keybase proof

I hereby claim:

  • I am klickreflex on github.
  • I am klick (https://keybase.io/klick) on keybase.
  • I have a public key ASC6bRK8fBWnMSX5d72tGy9MiliFMqRUpWbhCGTmVaR7_go

To claim this, I am signing this object:

View keybase.md

Keybase proof

I hereby claim:

  • I am klickreflex on github.
  • I am klick (https://keybase.io/klick) on keybase.
  • I have a public key ASCLM6K2fxCtIdwAt69qzuwBND88lNWp-eEvLQWkwuDy9Ao

To claim this, I am signing this object:

@klickreflex
klickreflex / _flexboxgrid.scss
Created Apr 11, 2017
Flexboxgrid Sass-Port with Helper classes
View _flexboxgrid.scss
// 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
@klickreflex
klickreflex / si_formatters.module.php
Last active Jul 27, 2016
Drupal Commerce: Add to Cart OR Download Formatter, https://www.drupal.org/node/2660424
View si_formatters.module.php
<?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 / .htaccess
Created Jul 4, 2016
gzip text with apache
View .htaccess
AddType image/svg+xml .svg
AddOutputFilterByType DEFLATE image/svg+xml text/html text/xml text/css text/javascript
View breakpoints.js
// 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 Jun 2, 2016
Drupal: Add Body Class when Tabs are displayed
View template.php
<?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';
}
}