Skip to content

Instantly share code, notes, and snippets.

@Chaser324
Chaser324 / GitHub-Forking.md
Last active February 20, 2025 17:06
GitHub Standard Fork & Pull Request Workflow

Whether you're trying to give back to the open source community or collaborating on your own projects, knowing how to properly fork and generate pull requests is essential. Unfortunately, it's quite easy to make mistakes or not know what you should do when you're initially learning the process. I know that I certainly had considerable initial trouble with it, and I found a lot of the information on GitHub and around the internet to be rather piecemeal and incomplete - part of the process described here, another there, common hangups in a different place, and so on.

In an attempt to coallate this information for myself and others, this short tutorial is what I've found to be fairly standard procedure for creating a fork, doing your work, issuing a pull request, and merging that pull request back into the original project.

Creating a Fork

Just head over to the GitHub page and click the "Fork" button. It's just that simple. Once you've done that, you can use your favorite git client to clone your repo or j

@cferdinandi
cferdinandi / terminal-cheat-sheet.txt
Last active February 27, 2025 20:11
Terminal Cheat Sheet
# Terminal Cheat Sheet
pwd # print working directory
ls # list files in directory
cd # change directory
~ # home directory
.. # up one directory
- # previous working directory
help # get help
-h # get help
@adactio
adactio / minimal-serviceworker.js
Last active August 18, 2023 09:15
An attempt at a minimal viable service worker.
// Licensed under a CC0 1.0 Universal (CC0 1.0) Public Domain Dedication
// http://creativecommons.org/publicdomain/zero/1.0/
// HTML files: try the network first, then the cache.
// Other files: try the cache first, then the network.
// Both: cache a fresh version if possible.
// (beware: the cache will grow and grow; there's no cleanup)
const cacheName = 'files';
@eddiewebb
eddiewebb / readme.md
Last active February 16, 2025 17:43
Hugo JS Searching with Fuse.js
@marcamos
marcamos / lazy-load.js
Last active February 2, 2022 14:19
Lazy-loading polyfill; it covers the various ways you can use an <img> element, <picture> elements, and CSS background images … but it gets out of the way if the environment natively supports lazy-loading.
// Use #1: <img> element using src and srcset:
// <img data-lazy-srcset="/path/to/image-2x.jpg 2x"
// data-lazy-src="/path/to/image-1x.jpg"
// alt="TODO" width="TODO" height="TODO" loading="lazy" />
//
// Use #2: <img> element using src, srcset, and sizes:
// <img data-lazy-srcset="your srcset list here"
// data-lazy-src="/path/to/image.jpg"
// sizes="your sizes list here"
// alt="TODO" width="TODO" height="TODO" loading="lazy" />
@wvpv
wvpv / SFMC-AMPscript-exclusion-script-content-block.amp
Created February 27, 2020 22:11
Exclusion Script Content Block - Prevent duplicates
%%[
var @contextInsertDate
set @contextInsertDate = AttributeValue("YOUR_TSD_DE_INSERT_DATE")
set @contextInsertDate = format(@contextInsertDate,"yyyyMMddhhmmss")
var @exclude
set @exclude = 0
@mohokh67
mohokh67 / timestamp-formatter.md
Created June 1, 2020 14:26
Get YYYY-MM-DD HH-MM-SS in JavaScript
const formatedTimestamp = ()=> {
  const d = new Date()
  const date = d.toISOString().split('T')[0];
  const time = d.toTimeString().split(' ')[0].replace(/:/g, '-');
  return `${date} ${time}`
}
@soerenmartius
soerenmartius / _src_modules_auth_store_index.ts
Last active June 29, 2023 02:28
Vue 3 with Typescriptt and Vuex 4 Typed Modules Examples ( with real types )
import {
ActionContext,
ActionTree,
GetterTree,
MutationTree,
Module,
Store as VuexStore,
CommitOptions,
DispatchOptions,
} from 'vuex'
import { useEffect } from 'react';
import { get } from 'lodash';
import { navigate } from 'gatsby';
import { useLoading } from '@luigiclaudio/ga-baseline-ui/helpers';
import { Identity } from '@luigiclaudio/ga-auth-theme';
const useUser = () => {
const { user, getFreshJWT, logoutUser } = Identity.useIdentityContext();
const [isLoading, load] = useLoading();
const tokenObject = get(user, 'token');
@eliotharper
eliotharper / UpdateQuery.js
Created January 31, 2021 09:48
Updates SFMC Query Activity with Auto-Suppression list as target Data Extension
<script language="javascript" runat="server">
// Author: Eliot Harper <[email protected]>
// Revision date: January 31, 2021
// DISCLAIMER
// While due care has been taken in the preparation of this
// supplied code example, no liability is assumed for incidental
// or consequential damages in connection with or arising out its
// use. Example code is provided on an "as is" basis and no
// expressed or implied warranty of any kind is made for the