Skip to content

Instantly share code, notes, and snippets.

View robpataki's full-sized avatar

Rob Pataki robpataki

  • Valtech
  • York UK
View GitHub Profile
@robpataki
robpataki / how-we-do-git.md
Last active February 14, 2025 18:21
This is how we do git (rebase, feature branches, PRs)

How to / Git

Branching strategy

We use a form of Git flow to maintain a stable master branch, and work off feature branches to introduce new features and other code updates. The feature branches are tied to JIRA tickets.

To keep our git log clean and tidy we use git's rebase strategy. That means that instead of merging commits in and out of the master branch (resulting in many ugly merge commits) we always keep our own feature branch's commits on top of the existing master branch commits.

You can read more about the rebase strategy here: https://www.atlassian.com/git/tutorials/merging-vs-rebasing.

@robpataki
robpataki / git-notes.md
Last active October 30, 2021 10:00
Git notes

Git notes

Change author of the last commit

git commit --amend --author="Rob Pataki <[email protected]>"

Prune remote branches on local

git remote prune origin
@robpataki
robpataki / time-travel.js
Created September 19, 2018 12:35
Display moment style dates in the front-end
/*
Example usage:
<span class="moment" data-moment="add 12 days"></span>
*/
'use strict'
import moment from 'moment'
/* TimeTravel */
@robpataki
robpataki / GoogleSheetAppScripts.gs
Created October 29, 2018 21:12
Custom App Scripts to generate sheets and calendar events using data from a spreadsheet
var CALENDAR_ID = 'XXX';
var CRUNCH_TEMPLATE_ID = 'XXX';
var CRUNCH_FOLDER_ID = 'XXX';
var NA = 'N/A';
var INVALID_DATE = 'Invalid Date';
var CALENDAR = CalendarApp.getCalendarById(CALENDAR_ID);
/* Populate custom menu */
function onOpen() {
var spreadsheet = SpreadsheetApp.getActive();
@robpataki
robpataki / nunjucks-snippets.njk
Created November 15, 2018 14:27
Nunjucks snippets
{# Conditionally render inline CSS class #}
<div class="govuk-grid-row {{ 'govuk-!-margin-top-9' if not(showBackButton) else 'govuk-!-margin-top-3' }}">
@robpataki
robpataki / thymeleaf-hashmap-examples.html
Created April 17, 2019 15:36
Thymeleaf hashmap examples - only saving it here so I don't have to ever think about it again :)
<!-- Define a hashmap -->
<ol class="app-task-list">
<th:block th:with="tasks=${ {{enabled: false, url: '', taskState: 'COMPLETED', titleCode: 'taskList.pre.section.checkEligibility'}} }">
<th:block th:replace="~{ fragments/task-list :: task-list-group(${tasks}, #{taskList.pre.section.title}, 1)}" />
</th:block>
<th:block th:replace="~{ fragments/task-list :: task-list-group(${tasks}, #{taskList.application.section.title}, 2)}" />
<th:block th:replace="~{ fragments/task-list :: task-list-group(${tasks}, #{taskList.apply.section.title}, 3)}" />
@robpataki
robpataki / _utils.scss
Created November 18, 2020 15:50
SASS Metaprogramming example - generate utility classes and placeholders
// stylelint-disable declaration-no-important
@use "sass:string";
// Settings
@use "scss-core/settings/vars";
// Use the built-in generator below to generate simple utility class and placeholder pairs
//
// An example utility:
@robpataki
robpataki / settings.json
Last active October 10, 2022 16:29
Visual Studio Code user settings
{
"eslint.run": "onSave",
"eslint.format.enable": true,
"eslint.validate": [
"javascript",
"javascriptreact",
"typescript",
"typescriptreact"
],
@robpataki
robpataki / _grid-settings.scss
Created February 28, 2023 18:08
Sass grid system with responsive breakpoint mixin
$columns: (
xs: 2,
s: 2,
m: 8,
l: 12,
xl: 12,
);
$gutters: (
xs:20px,
s: 20px,
@robpataki
robpataki / pointer.ts
Last active October 13, 2023 15:23
Pointer utility class for tracking pointer movement and clicks
let instance: Pointer;
/**
* Tracks the pointer in WebGL
*/
export default class Pointer {
/**
* Current coordinates
* @return {x: number, y: number} The current pointer coordinates.
*/