Skip to content

Instantly share code, notes, and snippets.

@eoghain
eoghain / FeatureFlag.swift
Created April 7, 2022 00:02
Feature Flags
import UIKit
/// Struct identifying a Feature Flag that is used to enable/disable access to a feature
///
/// example:
/// ```
/// // Only allow this feature on iPhones in the US if the flag is enabled
/// let featureFlag = FeatureFlag(name: "EnableMyFeature", localeRestrictions: ["en_US"], deviceTypes: [.phone])
/// guard featureFlag.isEnabled else { return }
/// ```
@mstanuch
mstanuch / build-keycloak-docker-image.sh
Created July 11, 2021 08:18
Apple M1 KeyCloak docker image build
#/bin/zsh
# Workaround for https://github.com/docker/for-mac/issues/5310
VERSION=14.0.0 # set version here
cd /tmp
git clone git@github.com:keycloak/keycloak-containers.git
cd keycloak-containers/server
git checkout $VERSION
@degitgitagitya
degitgitagitya / .env
Last active April 18, 2024 17:46
Next JS + Next Auth + Keycloak + AutoRefreshToken
# KEYCLOAK BASE URL
KEYCLOAK_BASE_URL=
# KEYCLOAK CLIENT SECRET
KEYCLOAK_CLIENT_SECRET=
# KEYCLOAK CLIENT ID
KEYCLOAK_CLIENT_ID=
# BASE URL FOR NEXT AUTH
@maoosi
maoosi / amplifyauth-scheme.ts
Last active October 26, 2021 18:24
[WIP] Custom amplify auth scheme for nuxt/auth (auth.nuxtjs.org).
import { Amplify, Auth, withSSRContext } from 'aws-amplify'
import { Auth as NuxtAuth } from '@nuxtjs/auth-next'
export interface AmplifyAuthSchemeOptions {
name: string
}
export default class AmplifyAuthScheme {
public $auth: NuxtAuth
public options: AmplifyAuthSchemeOptions
@gauravssnl
gauravssnl / build-and-release.yml
Created March 9, 2020 19:30
GitHub Actions workflow to build Flutter app and create Release, put this file under `.github/workflows` folder.
on:
push:
branches:
- master
name: Build and Release Apps
jobs:
build:
name: Build Apps
runs-on: macos-latest
@flar
flar / cached_frosted_backdrop.dart
Created January 4, 2020 04:23
Blurring a background with either a cached BackdropFilter or an ImageFiltered widget for comparison.
import 'dart:ui' as ui;
import 'package:flutter/material.dart';
import 'package:flutter/rendering.dart';
import 'package:flutter/scheduler.dart';
import 'package:flutter/services.dart';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
@override
@gokulkrishh
gokulkrishh / useful-npx-commands.md
Last active November 24, 2023 04:25
List of useful npx (Node Package Runner) commands (https://git.io/useful-npx-commands)

NPX (NPM Package Runner) Commands

List of useful npx (NPM Package Runner) commands.

What is NPX?

Using NPX we can execute/run node binaries without the need to install it locally or globally.

Commands

@felixblaschke
felixblaschke / fancy-background-app.dart
Created April 14, 2019 06:28
Fancy Background Animation
class FancyBackgroundApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Stack(
children: <Widget>[
Positioned.fill(child: AnimatedBackground()),
onBottom(AnimatedWave(
height: 180,
speed: 1.0,
)),
@timdown
timdown / range_selection_save_restore.js
Last active January 27, 2024 18:41
Range and selection marker-element-based save and restore
/**
* This is ported from Rangy's selection save and restore module and has no dependencies.
* Copyright 2019, Tim Down
* Licensed under the MIT license.
*
* Documentation: https://github.com/timdown/rangy/wiki/Selection-Save-Restore-Module
* Use "rangeSelectionSaveRestore" instead of "rangy"
*/
var rangeSelectionSaveRestore = (function() {
var markerTextChar = "\ufeff";
@vikaskore
vikaskore / RecordAudioViewController.swift
Last active November 29, 2023 21:48
Record and Play audio in iOS Swift
//
// RecordAudioViewController.swift
// Samples
//
// Created by VikasK on 11/02/19.
// Copyright © 2019 Vikaskore Software. All rights reserved.
//
import UIKit
import AVFoundation