Skip to content

Instantly share code, notes, and snippets.

View ambroisehdn's full-sized avatar
💭
🙂

Ambroise ambroisehdn

💭
🙂
View GitHub Profile
## Run this command to add this package as a library:
## --> flutter pub add shared_preferences
import 'package:flutter/material.dart';
import 'package:shared_preferences/shared_preferences.dart';
Future<void> main() async {
WidgetsFlutterBinding.ensureInitialized();
final SharedPreferences prefs = await SharedPreferences.getInstance();
@thomasdarimont
thomasdarimont / KeycloakAdminClientExample.java
Last active August 19, 2024 03:36
Using Keycloak Admin Client to create user with roles (Realm and Client level)
package demo.plain;
import org.keycloak.OAuth2Constants;
import org.keycloak.admin.client.CreatedResponseUtil;
import org.keycloak.admin.client.Keycloak;
import org.keycloak.admin.client.KeycloakBuilder;
import org.keycloak.admin.client.resource.RealmResource;
import org.keycloak.admin.client.resource.UserResource;
import org.keycloak.admin.client.resource.UsersResource;
import org.keycloak.representations.idm.ClientRepresentation;
@punchagan
punchagan / hello.py
Last active December 21, 2023 23:36
A simple Flask sockets example
# Copy of http://stackoverflow.com/a/20104705
from flask import Flask, render_template
from flask_sockets import Sockets
app = Flask(__name__)
app.debug = True
sockets = Sockets(app)
@sockets.route('/echo')