Skip to content

Instantly share code, notes, and snippets.

@kianenigma
kianenigma / staking-updates.md
Last active October 5, 2022 00:58
Polkadot's Monthly Staking Update

DEPRECATED: Polkadot Staking Progress Report

I started this gist as an index for all of the staking reports. Almost a year in, we migrated everything to https://polkadot.network/tag/staking-updates/. This page will no longer be updated:

@fgnass
fgnass / README.md
Created October 19, 2020 14:04
Next.js SSR + Capacitor

Goal

The goal is to package a server-side rendered Next.js app as SPA for capacitor.

Approach

Pages with dynamic routes/data use getServerSideProps(). For capacitor we need at least one page that can be rendered statically, preferably the index page.

When there are pages that use getServerSiedeProps() we can't use next export (it will fail with an error).

@dkarmalita
dkarmalita / react-observable-patterns.js
Created August 16, 2018 08:19
react-observable patterns example (rxjs v6, react-observable v1)
// "rxjs": "^6.2.1" && "redux-observable": "^1.0.0-beta.2"
import { of, from, forkJoin } from 'rxjs';
import { mergeMap, catchError, ignoreElements, tap } from 'rxjs/operators';
const setData = (type, payload={}) => ({type, payload})
// Run simple async request
export const asyncEpic = (action$, store, { api }) =>
action$.ofType('START_ASYNC')
@jonkwheeler
jonkwheeler / RevealText.js
Last active May 2, 2024 05:46
React: Animation component using GSAP's SplitText plugin to reveal text on a page
// @flow
import { PureComponent, type Node, Fragment } from 'react';
import { TimelineLite } from 'gsap';
import SplitText from 'Lib/gsap-bonus/umd/SplitText';
import Waypoint from 'react-waypoint';
type RevealTextProps = {
children: Node,
waypointTopOffset: string,
waypointBottomOffset: string,
@cartpauj
cartpauj / memberpress-hooks.php
Last active July 16, 2024 19:03
Various Subscription and Transaction status hooks for MemberPress with some helpful comments
<?php
//Capture a new member signup. Only ever triggers once for each new member.
//Does not trigger for exising members who have subscribed to a Membership before.
//
//The user may not be logged in when this is called
//as it is triggered when a user is added over the REST API,
//and also when a user is added from the dashboard (MemberPress -> Members -> Add New)
function mepr_capture_new_member_signup_completed($event) {
$user = $event->get_data();
$txn_data = json_decode($event->args);
@Geoff-Ford
Geoff-Ford / composing-software.md
Last active July 18, 2024 08:32
Eric Elliott's Composing Software Series

Eric Elliott's "Composing Software" Series

A collection of links to the excellent "Composing Software" series of medium stories by Eric Elliott.

Edit: I see that each post in the series now has index, previous and next links. However, they don't follow a linear flow through all the articles with some pointing back to previous posts effectively locking you in a loop.

@joshbuchea
joshbuchea / semantic-commit-messages.md
Last active July 24, 2024 08:58
Semantic Commit Messages

Semantic Commit Messages

See how a minor change to your commit message style can make you a better programmer.

Format: <type>(<scope>): <subject>

<scope> is optional

Example

@anxiousmodernman
anxiousmodernman / CONTRIBUTING.md
Last active August 15, 2021 08:28
CONTRIBUTING.md

Code Quality and Contribution Guidelines

Tests

Code should be submitted with a reasonable suite of tests, and code should be designed with testability in mind.

Commit Messages

Commit messages should explain why code is changing, configuration is added,

@hal0gen
hal0gen / _mobile-ready-web-app.html
Last active July 24, 2024 10:25 — forked from tfausak/ios-8-web-app.html
iOS + Android settings for web applications
<!doctype html>
<!-- Adapted from https://gist.github.com/tfausak/2222823 -->
<html>
<head>
<title>Mobile-ready web app</title>
<!-- CONFIGURATION -->
@nathansmith
nathansmith / [1] convertToMarkup.js
Last active November 16, 2023 12:43
Handy utilities for dealing with `<div contenteditable="true">` areas.
// Helpers.
import { convertToText } from './';
/*
You would call this when receiving a plain text
value back from an API, and before inserting the
text into the `contenteditable` area on a page.
*/
const convertToMarkup = (str = '') => {
return convertToText(str).replace(/\n/g, '<br>');