Skip to content

Instantly share code, notes, and snippets.

View mattmccray's full-sized avatar

Matt McCray mattmccray

View GitHub Profile
@yifanzz
yifanzz / code-editor-rules.md
Created December 17, 2024 00:01
EP12 - The One File to Rule Them All

[Project Name]

Every time you choose to apply a rule(s), explicitly state the rule(s) in the output. You can abbreviate the rule description to a single word or phrase.

Project Context

[Brief description ]

  • [more description]
  • [more description]
  • [more description]
@marnixk
marnixk / pocketbase_stripe_utils.js
Created July 18, 2024 10:15
Pocketbase Stripe Javascript Functions
/*
____ _ _ _ _ _ _ _
/ ___|| |_ _ __(_)_ __ ___ | | | | |_(_) |___
\___ \| __| '__| | '_ \ / _ \ | | | | __| | / __|
___) | |_| | | | |_) | __/ | |_| | |_| | \__ \
|____/ \__|_| |_| .__/ \___| \___/ \__|_|_|___/
|_|
Purpose:
@Basti3n
Basti3n / README.md
Last active February 1, 2024 02:57
Minecraft ALL THE MOD 8 / ATM8 - Docker (Compose) setup

Installation

@asukakenji
asukakenji / 0-go-os-arch.md
Last active April 5, 2025 21:07
Go (Golang) GOOS and GOARCH

Go (Golang) GOOS and GOARCH

All of the following information is based on go version go1.17.1 darwin/amd64.

GOOS Values

GOOS Out of the Box
aix
android
var str = 'class ಠ_ಠ extends Array {constructor(j = "a", ...c) {const q = (({u: e}) => {return { [`s${c}`]: Symbol(j) };})({});super(j, q, ...c);}}' +
'new Promise((f) => {const a = function* (){return "\u{20BB7}".match(/./u)[0].length === 2 || true;};for (let vre of a()) {' +
'const [uw, as, he, re] = [new Set(), new WeakSet(), new Map(), new WeakMap()];break;}f(new Proxy({}, {get: (han, h) => h in han ? han[h] ' +
': "42".repeat(0o10)}));}).then(bi => new ಠ_ಠ(bi.rd));';
try {
eval(str);
} catch(e) {
alert('Your browser does not support ES6!')
}
@pizzarob
pizzarob / 01_DropZone.jsx
Last active July 12, 2024 07:05
HTML5 Drag and Drop File Upload React Component
import React from 'react';
import PropTypes from 'prop-types';
import classNames from 'classnames';
const ANIMATION_DURATION = 1000;
class BatchDropZone extends React.Component {
static propTypes = {
@kofifus
kofifus / Codemirror spellchecker with typo corrections
Last active May 16, 2024 13:05
CodeMirror spell checker with typo correction
usage:
------
// include codemirror.js, addon/mode/overlay.js
// include async typo.js from https://github.com/cfinke/Typo.js/pull/45
// include loadTypo.js from: https://github.com/cfinke/Typo.js/pull/50
// loading typo + dicts takes a while so we start it first
// hosting the dicts on your local domain will give much faster loading time
// english dictionaries taken from https://github.com/cfinke/Typo.js/pull/47
@mweststrate
mweststrate / typeswitcher.ts
Created April 14, 2016 14:01
(TypeScript) typeswitcher, like switch, but with constructor based cases and expressions with inferred types
/**
* Usage:
typeSwitch(someInstance, defaultvalue)
.when(MyClass, i => result)
.when(OtherClass, i => otherResult)
.get()
In the expressions, the type of the 'i' param should be inferred correctly, see the attribute default value checks
*/
export function typeSwitch<T, R>(instance: T, defaultValue?: R): TypeSwitcher<T, R> {
@gaearon
gaearon / reducers.js
Last active December 11, 2020 14:56
How I'd do code splitting in Redux (pseudo code, not tested!)
import { combineReducers } from 'redux';
import users from './reducers/users';
import posts from './reducers/posts';
export default function createReducer(asyncReducers) {
return combineReducers({
users,
posts,
...asyncReducers
});
@cem2ran
cem2ran / main.js
Created December 28, 2015 01:10
React Getting Started - How it should be!
import React from 'react'
import ReactDOM from 'react-dom'
const Hello = ({name}) => <h1>Hello {name}!</h1>
ReactDOM.render(
<Hello name={"vjeux"}/>,
document.body.appendChild(document.createElement("div"))
)