Skip to content

Instantly share code, notes, and snippets.

View budparr's full-sized avatar
🎯
Focusing

Bud Parr budparr

🎯
Focusing
View GitHub Profile
@danieleggert
danieleggert / GPG and git on macOS.md
Last active March 6, 2025 20:45
How to set up git to use the GPG Suite

GPG and git on macOS

Setup

No need for homebrew or anything like that. Works with https://www.git-tower.com and the command line.

  1. Install https://gpgtools.org -- I'd suggest to do a customized install and deselect GPGMail.
  2. Create or import a key -- see below for https://keybase.io
  3. Run gpg --list-secret-keys and look for sec, use the key ID for the next step
  4. Configure git to use GPG -- replace the key with the one from gpg --list-secret-keys
@gunjanpatel
gunjanpatel / revert-a-commit.md
Last active March 12, 2025 04:26
Git HowTo: revert a commit already pushed to a remote repository

Revert the full commit

Sometimes you may want to undo a whole commit with all changes. Instead of going through all the changes manually, you can simply tell git to revert a commit, which does not even have to be the last one. Reverting a commit means to create a new commit that undoes all changes that were made in the bad commit. Just like above, the bad commit remains there, but it no longer affects the the current master and any future commits on top of it.

git revert {commit_id}

About History Rewriting

Delete the last commit

Deleting the last commit is the easiest case. Let's say we have a remote origin with branch master that currently points to commit dd61ab32. We want to remove the top commit. Translated to git terminology, we want to force the master branch of the origin remote repository to the parent of dd61ab32:

@robinrendle
robinrendle / browsersync-webpack.md
Last active September 17, 2024 16:58
Getting set up with Browsersync and Webpack

Fixing our local environment with Browsersync

Whenever we change our templates we still have to use our build script and this can get annoying. Thankfully with webpack-dev-server and BrowserSync we can fix this:

npm i -D browser-sync browser-sync-webpack-plugin webpack-dev-server

BrowserSync will act like a proxy, waiting for webpack to do its thing and then reloading the browser for us.

@thegitfather
thegitfather / vanilla-js-cheatsheet.md
Last active April 7, 2025 02:00
Vanilla JavaScript Quick Reference / Cheatsheet
@daviddarnes
daviddarnes / _config.yml
Last active April 7, 2016 14:52
Jekyll head meta
# Permalinks
permalink: pretty
# Posts
excerpt_separator: <!-- more -->
# Site info
url: "https://darn.es"
title: "David Darnes"
description: "Web Designer & Front-end Developer"
@roobottom
roobottom / jekyll-get-date-from-filename.js
Last active February 11, 2016 02:14
This file will read a bunch of Jekyll formatted `.md` posts in a folder, grab the date from the filename and write it into the front-matter. Files are copied to a new folder, rather than overwritten.
/*
This file will read a bunch of Jekyll formatted `.md` posts in a folder,
grab the date from the filename and write it into the front-matter.
Files are copied to a new folder, rather than overwritten.
Requirements: `npm install lodash`, and that's it!
*/
var fs = require('fs'),
@becker1701
becker1701 / post.rb
Created November 19, 2015 18:54
Category slugify plugin for Jekyll 3.0.0: This plugin will slugify the categories listed in the YML frontmatter. Categories with multiple words will have the spaces replaced with dashes. Put this file in the _plugins directory.
module Jekyll
class Document
#Updated for Jekyll 3.0.0
# override post method in order to return categories names as slug
# instead of strings
#
# An url for a post with category "category with space" will be in
@paulirish
paulirish / bling.js
Last active February 18, 2025 14:08
bling dot js
/* bling.js */
window.$ = document.querySelector.bind(document);
window.$$ = document.querySelectorAll.bind(document);
Node.prototype.on = window.on = function(name, fn) { this.addEventListener(name, fn); };
NodeList.prototype.__proto__ = Array.prototype;
NodeList.prototype.on = function(name, fn) { this.forEach((elem) => elem.on(name, fn)); };
anonymous
anonymous / contentblocks.rb
Created March 21, 2015 23:29
Gives you a mechanism in Jekyll to pass content up from pages into their parent layouts. It's kind of like having Rails' content_for available for Jekyll.
# Plugin: jekyll-contentblocks
# Author: Rusty Geldmacher
# Git: https://github.com/rustygeldmacher/jekyll-contentblocks
# Instructions: https://github.com/rustygeldmacher/jekyll-contentblocks#usage
module Jekyll
module ContentBlocks
VERSION = "0.0.3"
module Common
def get_content_block_name(tag_name, block_name)
block_name = (block_name || '').strip