Skip to content

Instantly share code, notes, and snippets.

Avatar

Marc Löhe bfncs

View GitHub Profile
@bfncs
bfncs / PagePathHistoryLanguage.module
Created March 21, 2015 14:59
Multilanguage page name aware Page Path History module for Processwire
View PagePathHistoryLanguage.module
<?php
/**
* ProcessWire Page Path History
*
* Keeps track of past URLs where pages have lived and automatically 301 redirects
* to the new location whenever the past URL is accessed.
* This module is a fork of the original PagePathHistory by Ryan Cramer in the Processwire
* Core and should ideally be merged back there.
*
@bfncs
bfncs / jquery.defaultvalues.js
Created March 10, 2012 10:14
jQuery Plugin: Default form values from labels
View jquery.defaultvalues.js
/* DefaultValues v0.1 - Form input default values from labels
* by Marc Loehe
* http://marcloehe.de
*/
(function ($) {
$.fn.DefaultValues = function() {
return this.each(function() {
var form = $(this);
$(this).find('input[type=text], textarea').each(function() {
@bfncs
bfncs / TextAreaCounter.js
Created December 11, 2012 14:24
TextArea Counter for Processwire
View TextAreaCounter.js
(function ($) {
var checkWordLimit = function (elem) {
console.log('recalc');
var count = elem.attr('data-maxwords') - elem.val().split(/\s+/).length;
elem.parent().find("span.counterWords span").text(count);
};
$(document).ready(function () {
$('textarea[data-maxchars]').each(function () {
var $this = $(this);
@bfncs
bfncs / index.html
Last active December 16, 2015 19:49
Webfonts asynchron von fonts.com laden Demo: http://by.byteb.us/0hLYzb
View index.html
<!DOCTYPE html>
<!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7" lang="de"> <![endif]-->
<!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8" lang="de"> <![endif]-->
<!--[if IE 8]> <html class="no-js lt-ie9" lang="de"> <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js" lang="de"> <!--<![endif]-->
<head>
<meta charset="utf-8" />
<link rel="dns-prefetch" href="//fast.fonts.com" />
<title>Fonts.com asynchronous loading test</title>
<meta name="description" content="Lorem ipsum ist ein Blindtext, der nichts bedeutet, aber gut aussieht." />
@bfncs
bfncs / HelperAuthorTags.module
Last active December 19, 2015 09:59
Processwire Module: HelperAuthorTags
View HelperAuthorTags.module
<?php
class HelperAuthorTags extends WireData implements Module
{
public static function getModuleInfo()
{
return array(
@bfncs
bfncs / README.md
Last active May 25, 2016 01:34
Demo: Different page transitions based on clicked anchor with smoothState.js
View README.md

Demo: Different page transitions based on clicked anchor with smoothState.js

This demo shows how to switch transitions based on initiating link with smoothState.js. This solution has been inspired by @pudgereyem's comment on smoothState.js #143.

You can view the demo here.

The demo implements a crude idea of viewports that are horizontally aligned to determine the needed animation: every anchor has a numeric data-target paramter that represents the needed viewport while every scene element provides a numeric data-viewport parameter that reprents the current viewport. If the viewport requested for the clicked target is larger then the current viewport, the scene element is moved to the left, else to the right.

The logic to determine the wanted ani

@bfncs
bfncs / README.md
Created November 4, 2016 11:09
Login Web Testcafe
View ghmatch.js
const request = require('request-promise-native');
const Set = require('immutable').Set;
const parseLinkHeader = require('parse-link-header');
const fetchRepos = uri =>
request({
uri,
json: true,
resolveWithFullResponse: true,
headers: { 'User-Agent': 'ghmatch' },
@bfncs
bfncs / arbeiten_auf_der_bash-konsole.md
Created August 27, 2012 08:22
Arbeiten auf der Bash-Konsole
View arbeiten_auf_der_bash-konsole.md

Arbeiten auf der Bash-Konsole

In Verzeichnissen navigieren

Grundlagen

Unter Linux und allen anderen auf UNIX basierenden Betriebssystemen (Mac OS, BSD, etc) werden alle Dateien innerhalb eines einzigen hierarchischen Baumes organisiert; Ordner können weitere Ordner oder Dateien enthalten.

Diese Hierarchie startet mit dem Ordner /, der sogenannten "Root-Verzeichnis". Von dort aus kann jeder Ort im Dateisystem durch Angabe eines absoluten Pfades erreicht werden. Absolute Pfade erkennt man daran, dass Sie mit einem / beginnen, der für das Root-Verzeichnis steht. Das eigene Verzeichnis befindet sich im Normalfall etwa unter dem absolut Pfad /home/username/ (wobei username dem eigenen Benutzernamen entsprechen muss).

@bfncs
bfncs / readme.md
Created September 17, 2013 13:52
Gestalten für's Web
View readme.md

Einführung in Webgestaltung

Grundwissen anlesen

Um fürs Web gestalten zu können muss man zunächst einmal CSS verstehen, denn damit legt man fest, wie eine Seite aussieht. Dafür braucht man allerdings ein gewisses Fundament was den Aufbau von HTML angeht.

Um andere Techniken (JavaScript für Interaktivität im Browser, PHP und andere Skriptsprachen für dynamisch generierte Seiten auf dem Server) kann man erst mal einen ganz großen Bogen machen, wenn es nur um Gestaltung gehen soll.

Für das Verständnis gibt es einige ziemlich gute Seiten im Netz: