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 / 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 / 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@email.email>"

Prune remote branches on local

git remote prune origin
@robpataki
robpataki / how-we-do-git.md
Last active May 30, 2022 15:16
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 / class-twiddler.js
Last active April 6, 2018 08:40
Vanilla JavaScript utility functions to manipulate DOM element class names (IE6 compatible)
(function() {
function pruneSpaces(el) {
el.className = el.className.replace(/^\s+|\s+$/g, '');
}
function toggleClass(el, className) {
if (hasClass(el, className)) {
removeClass(el, className);
} else {
addClass(el, className);
@robpataki
robpataki / vagrant-notes.md
Created November 9, 2017 12:29
Vagrant notes

Vagrant notes

Get the currently used environment and auth credentials from Vagrant

  $ vagrant ssh
  $ cd /srv/www/[project_name]/current
  $ cat .env
@robpataki
robpataki / ssl-certbot.md
Last active November 8, 2017 09:32
SSL certificate notes

SSL certificates on Linode instance

Use certbot

Auto renew certificates

./certbot-auto renew --dry-run
...
./certbot-auto renew --quiet --no-self-upgrade
@robpataki
robpataki / MySQL-Notes.md
Last active November 8, 2017 17:33
MariaDB / MySQL notes

Important MySQL Commands

Enter MySQL

$ sudo mysql

List databases

$ show databases;
@robpataki
robpataki / _easing-functions.scss
Last active August 10, 2022 18:51
Easing functions to be used in SCSS
// Easing function variables - http://easings.net/#easeOutQuint
// SINE
$ease-in-sine: cubic-bezier(0.47, 0, 0.745, 0.715);
$ease-out-sine: cubic-bezier(0.39, 0.575, 0.565, 1);
$ease-in-out-sine: cubic-bezier(0.445, 0.05, 0.55, 0.95);
// QUAD
$ease-in-quad: cubic-bezier(0.55, 0.085, 0.68, 0.53);
$ease-out-quad: cubic-bezier(0.25, 0.46, 0.45, 0.94);
@robpataki
robpataki / name_changer-notes.md
Last active May 21, 2017 18:30
Notes for the NameChanger app for Mac

Notes for NameChanger App for Mac

Regular Expressions

Insert a '-' after the track number

  • Example: change - 01 Blah to - 01 - Blah
  • Original Text field: ( - [0-9][0-9] )
  • New Text field: $1-
@robpataki
robpataki / dotcon.js
Created May 12, 2017 11:41
Betterer version of SVGConnector
/*!
* Dot Connector
* Rob Pataki [hello@robp.io] [https://robp.io]
* Date: 2017-05-04
* Demo: https://jsfiddle.net/robertp/zsrn3e5o/
*/
var NS = 'http://www.w3.org/2000/svg';
var DotCon = function(artboardElement) {