Skip to content

Instantly share code, notes, and snippets.

View jmartsch's full-sized avatar

Jens Martsch jmartsch

View GitHub Profile
@jmartsch
jmartsch / dabblet.css
Created March 20, 2013 00:02
Pure CSS Tooltips with unicode arrow and shadow
/*
* Pure CSS Tooltips with unicode arrow and shadow
*/
.ui-tooltip, .ui-tooltip-top, .ui-tooltip-right, .ui-tooltip-bottom, .ui-tooltip-left {
color:#ffffff;
cursor:normal;
display:-moz-inline-stack;
display:inline-block;
font-size:12px;
font-family:arial;
@jmartsch
jmartsch / processwiresnippets.php
Created June 4, 2013 12:30
Common used code snippets for Processwire
// First child redirect
<?php if($page->numChildren) $session->redirect($page->child()->url);
// Redirect to specific page
$session->redirect($pages->get('/')->url);
// Create a menu, needs MarkupSimpleNavigation Plugin
<?php
$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
jmartsch / Gruntfile.coffee
Last active July 15, 2016 12:10
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'
<script src="path/to/jquery.js"></script>
<script src="path/to/rethinkpagination/scripts/rethinkpagination.min.js"></script>
<script>
jQuery(function($) {
$('.pagination').rethinkpagination();
});
</script>
<link rel="stylesheet" href="rethinkpagination/styles/rethinkpagination.css">
jQuery(function($) {
$('.pagination').rethinkpagination({animation: 'fadeInDown', selector: 'h1'});
});
bower install rethinkpagination
pasting this temporarily into any one of your templates, and then viewing a page that uses the template
<?php
$u = $users->get('admin'); // or whatever your username is
$u->of(false);
$u->pass = 'your-new-password';
$u->save();
@jmartsch
jmartsch / home.php
Last active October 11, 2018 10:33
ProcessWire: Output an admin template on the frontend
<?php namespace ProcessWire;
$uikit = $this->modules->get('AdminThemeUikit');
$uikit->init();
?>
<html>
<link rel="stylesheet" href="<?php echo $uikit->getUikitCSS() ?>"/>
<head>
</head>
<body>
<?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
{