Skip to content

Instantly share code, notes, and snippets.

Avatar

Jens Martsch jmartsch

View GitHub Profile
View Using Git to Manage a Live Web Site.md

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

View email.html
<!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;
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
{
@jmartsch
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');
$uikit->init();
?>
<html>
<link rel="stylesheet" href="<?php echo $uikit->getUikitCSS() ?>"/>
<head>
</head>
<body>
View ProcessWire reset password
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();
View rethinkpagination with options
jQuery(function($) {
$('.pagination').rethinkpagination({animation: 'fadeInDown', selector: 'h1'});
});
View add rethinkpagination stylesheet
<link rel="stylesheet" href="rethinkpagination/styles/rethinkpagination.css">
View rethinkpagination installation
<script src="path/to/jquery.js"></script>
<script src="path/to/rethinkpagination/scripts/rethinkpagination.min.js"></script>
<script>
jQuery(function($) {
$('.pagination').rethinkpagination();
});
</script>
@jmartsch
jmartsch / Gruntfile.coffee
Last active Jul 15, 2016
Gruntfile with browser-sync and assemble for static html files
View Gruntfile.coffee
# 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'