Skip to content

Instantly share code, notes, and snippets.


Jens Martsch jmartsch

View GitHub Profile
View Using Git to Manage a Live Web

Using Git to Manage a Live Web Site


As a freelancer, I build a lot of web sites. That's a lot of code changes to track. Thankfully, a Git-enabled workflow with proper branching makes short work of project tracking. I can easily see development features in branches as well as a snapshot of the sites' production code. A nice addition to that workflow is that ability to use Git to push updates to any of the various sites I work on while committing changes.


View ExportAllFieldsAsCSV.module
<?php namespace ProcessWire;
* An action that lets you export all fields of pages to a CSV file
* Class ExportAllFieldsAsCSV
* @package ProcessWire
class ExportAllFieldsAsCSV extends PageAction implements Module
View email.html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">
<html xmlns="" lang="en" xml:lang="en" style="background: #f7f6f1;">
<link rel="stylesheet" type="text/css" href="css/app.css">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="viewport" content="width=device-width">
<title>Newsletter 04-2018</title>
<style type="text/css">@media only screen {html{min-height: 100%;
background: #f7f6f1;}}@media only screen and (max-width: 628px) {.small-text-center{text-align: center !important;}.small-text-left{text-align: left !important;}}a:hover,a:active{color: #a0080d;}a:visited{color: #d10a11;}@media only screen and (max-width: 628px) {table.body img{width: auto;
jmartsch / home.php
Last active Oct 11, 2018
ProcessWire: Output an admin template on the frontend
View home.php
<?php namespace ProcessWire;
$uikit = $this->modules->get('AdminThemeUikit');
<link rel="stylesheet" href="<?php echo $uikit->getUikitCSS() ?>"/>
View ProcessWire reset password
pasting this temporarily into any one of your templates, and then viewing a page that uses the template
$u = $users->get('admin'); // or whatever your username is
$u->pass = 'your-new-password';
jmartsch /
Last active Jul 15, 2016
Gruntfile with browser-sync and assemble for static html files
# Generated on 2013-10-28 using generator-bootstrap-less 3.0.3
"use strict"
#lrSnippet = require("grunt-contrib-livereload/lib/utils").livereloadSnippet
#mountFolder = (connect, dir) ->
# connect.static require("path").resolve(dir)
# # Globbing
# for performance reasons we're only matching one level down:
# 'test/spec/{,*/}*.js'
jmartsch / processwiresnippets.php
Created Jun 4, 2013
Common used code snippets for Processwire
View processwiresnippets.php
// First child redirect
<?php if($page->numChildren) $session->redirect($page->child()->url);
// Redirect to specific page
// Create a menu, needs MarkupSimpleNavigation Plugin
$treeMenu = $modules->get("MarkupSimpleNavigation"); // load the module
$rootPage = $pages->get("/ueber-uns/"); // if you want to overwrite start level for the menu, for example for breadcrumbs
jmartsch / dabblet.css
Created Mar 20, 2013
Pure CSS Tooltips with unicode arrow and shadow
View dabblet.css
* Pure CSS Tooltips with unicode arrow and shadow
.ui-tooltip, .ui-tooltip-top, .ui-tooltip-right, .ui-tooltip-bottom, .ui-tooltip-left {
View rethinkpagination installation
<script src="path/to/jquery.js"></script>
<script src="path/to/rethinkpagination/scripts/rethinkpagination.min.js"></script>
jQuery(function($) {