Skip to content

Instantly share code, notes, and snippets.

View jmartsch's full-sized avatar

Jens Martsch jmartsch

View GitHub Profile
@jmartsch
jmartsch / README.md
Last active March 11, 2024 16:35
vite + Tailwind CSS setup for ProcessWire

Install vite and tailwind and needed plugins

npm install -D vite tailwindcss postcss autoprefixer postcss-custom-properties postcss-nested vite-plugin-live-reload

Using Git to Manage a Live Web Site

Overview

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.

Contents

<!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" lang="en" xml:lang="en" style="background: #f7f6f1;">
<head>
<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;
<?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
{
@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>
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();
bower install rethinkpagination
jQuery(function($) {
$('.pagination').rethinkpagination({animation: 'fadeInDown', selector: 'h1'});
});
<link rel="stylesheet" href="rethinkpagination/styles/rethinkpagination.css">
<script src="path/to/jquery.js"></script>
<script src="path/to/rethinkpagination/scripts/rethinkpagination.min.js"></script>
<script>
jQuery(function($) {
$('.pagination').rethinkpagination();
});
</script>