Skip to content

Instantly share code, notes, and snippets.

View bfncs's full-sized avatar

Marc Löhe bfncs

View GitHub Profile
@bfncs
bfncs / defaultTemplateByParentTv.plugin.php
Created December 13, 2011 23:55
Default Children Template by Parent TV - modX Revolution Plugin
<?php
/**
* =========================
* defaultTemplateByParentTv
* =========================
*
* Plugin for modX Revolution
* Set default template for children of a ressource
*
* Author:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="application/xhtml+xml; charset=UTF-8" />
<meta name="generator" content="Railroad Diagram Generator 1.59.1797" />
<style type="text/css">
::-moz-selection
{
color: #FFFCF0;
background: #0F0C00;
}
@bfncs
bfncs / .gitignore
Last active February 7, 2020 18:33
Panini Kata
node_modules
package-lock.json
@bfncs
bfncs / RecordDeserializationTest.java
Created December 11, 2020 08:34
Jackson: Deserializing to single-value Record from scalar values
package us.byteb.jackson;
import static org.junit.jupiter.api.Assertions.assertEquals;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonValue;
import com.fasterxml.jackson.databind.ObjectMapper;
import org.junit.jupiter.api.Test;
@bfncs
bfncs / mouse.js
Created March 12, 2012 09:41
Read Linux mouse(s) in node.js
/**
* Read Linux mouse(s) in node.js
* Author: Marc Loehe (marcloehe@gmail.com)
*
* Adapted from Tim Caswell's nice solution to read a linux joystick
* http://nodebits.org/linux-joystick
* https://github.com/nodebits/linux-joystick
*/
var fs = require('fs'),
@bfncs
bfncs / jquery.animbpos.js
Created March 13, 2012 18:41
jQuery Plugin: Animate Background Position
/**
* jQuery: animate background position
* Author: Marc Löhe
* Based on a work by Alexander Farkas
*/
(function ($) {
$.extend($.fx.step,{
backgroundPosition: function(fx) {
if (fx.state === 0) {
@bfncs
bfncs / arbeiten_auf_der_bash-konsole.md
Created August 27, 2012 08:22
Arbeiten auf der Bash-Konsole

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).