Skip to content

Instantly share code, notes, and snippets.

@huksley
huksley / mrsk.md
Last active January 12, 2024 17:24
mrsk - the missing manual

MRSK

This documentation adds important additions to the docs for mrsk deploy tool (see github.com/mrsked/mrsk)

Destination flag

You can use mrsk deploy --destination staging

This will read config/deploy.yml and config/deploy.staging.yml files, and also will read .env.staging file if it exists.

@huksley
huksley / deploy.yml
Last active February 11, 2024 07:21
Full configuration example for mrsk for NextJS. Save as config/deploy.yml See more at https://github.com/mrsked/mrsk
# yaml-language-server: $schema=https://raw.githubusercontent.com/kjellberg/mrsk/validate-with-json-schema/lib/mrsk/configuration/schema.yaml
service: testexample
image: githubuser/test/main
servers:
web:
hosts:
- 1.1.1.1
labels:
traefik.http.routers.web.rule: Host(`test.example.com`)
traefik.http.routers.web_secure.entrypoints: websecure
@axeldelafosse
axeldelafosse / react-native-mmkv-plugin.js
Last active October 12, 2023 19:57
[DEPRECATED] React Native MMKV - Config plugin for Expo. You need to use "react-native-mmkv": "^1.6.2"
// DEPRECATED
const {
withDangerousMod,
WarningAggregator,
AndroidConfig,
withAppBuildGradle,
} = require("@expo/config-plugins");
const path = require("path");
const fs = require("fs");
@GregBrimble
GregBrimble / image-test.tsx
Created September 27, 2021 09:41
Example of Cloudflare Images on Next.js (WIP)
import Image, { ImageLoader } from "next/image";
type Width = [string, number];
const widths = {
sm: 640,
md: 768,
lg: 1024,
xl: 1280,
};
@j-bullard
j-bullard / App.tsx
Created July 4, 2021 07:15
Headless UI with React Hook Forms
import "./styles.css";
import { Person } from "./types";
import { Listbox } from "./listbox/listbox";
import { useForm } from "react-hook-form";
const people: Person[] = [
{ id: 1, name: "Durward Reynolds", unavailable: false },
{ id: 2, name: "Kenton Towne", unavailable: false },
{ id: 3, name: "Therese Wunsch", unavailable: false },
{ id: 4, name: "Benedict Kessler", unavailable: true },
@0xced
0xced / Podfile
Created January 23, 2020 11:48
Sample Podfile with common workarounds: disable warnings for pods, using a branch, deleting deployment target from pods project, deleting swift files
platform :ios, '12.0'
target 'MyApp' do
inhibit_all_warnings!
pod 'libextobjc/EXTKeyPathCoding', '0.6'
pod 'libextobjc/EXTScope', '0.6'
pod 'Mantle', '~> 2.1'
pod 'RSParser', :git => 'https://github.com/0xced/RSParser', :branch => 'nsarray'
end
@DimosthenisK
DimosthenisK / self.decorator.ts
Created December 17, 2019 10:14
NestJS Guard + Decorator that allows user access limit to his own resources
import { SetMetadata } from '@nestjs/common';
export interface SelfDecoratorParams {
userIDParam: string;
allowAdmins?: boolean;
}
export const Self = (params: SelfDecoratorParams | string) =>
SetMetadata(
'selfParams',
@bmaupin
bmaupin / open-source-sso.md
Last active April 11, 2024 09:36
Comparison of some open-source SSO implementations

ⓘ This list is not meant to be exhaustive and is not guaranteed to be maintained. See the comments for updates and alternative options.

(Items in bold indicate possible concerns)

Keycloak WSO2 Identity Server Gluu CAS OpenAM Shibboleth IdP
OpenID Connect/OAuth support yes yes yes yes yes yes
Multi-factor authentication yes yes yes yes yes yes
Admin UI yes yes yes yes yes no
OpenJDK support yes yes partial² yes
@holmberd
holmberd / deploy-keys.md
Last active February 11, 2024 20:36
Setup GitHub repository SSH deploy keys

Setup GitHub repository SSH deploy keys

  1. Create GitHub repository in github and save the SSH repository url

  2. Init git on server in code directory

  • git init
  1. Create SSH keys on the server
  • ssh-keygen -t rsa -b 4096 -C your@email.here
  • Rename the key that doesn't end with .pub to repo-name.deploy.pem
@ericelliott
ericelliott / defaults-overrides.md
Last active May 7, 2023 13:52
ES6 defaults / overrides pattern

ES6 Defaults / Overrides Pattern

Combine default parameters and destructuring for a compact version of the defaults / overrides pattern.

function foo ({
    bar = 'no',
    baz = 'works!'
  } = {}) {