Skip to content

Instantly share code, notes, and snippets.

@Chralu
Chralu / main.ts
Created May 12, 2025 09:04
Copy labels, milestones & issues from a project to another one
import { Octokit, RestEndpointMethodTypes } from "@octokit/rest"
import 'dotenv/config'
class GhOrg {
octokit: Octokit
owner: string
constructor(params: { token: string, owner: string }) {
this.owner = params.owner
this.octokit = new Octokit({ auth: params.token })
@Chralu
Chralu / providers_tracker.dart
Created December 19, 2024 19:29
Debugging tool to keep track of Riverpod providers.
import 'dart:async';
import 'dart:core';
import 'package:flutter/foundation.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart';
/// Keeps track of alive providers.
///
/// > Usage in production is not recommended.
///

Keybase proof

I hereby claim:

  • I am chralu on github.
  • I am chralu (https://keybase.io/chralu) on keybase.
  • I have a public key ASBz-T9RRueGOnDfznGTvyOiIgKfMeWFPjY3PMFmPWGY6go

To claim this, I am signing this object:

@Chralu
Chralu / main.dart
Last active March 20, 2023 10:05
Form- custom textfield
import 'package:flutter/material.dart';
const Color darkBlue = Color.fromARGB(255, 18, 32, 47);
void main() {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({super.key});
@Chralu
Chralu / main.dart
Last active September 26, 2022 15:54
Flutter101 - Layout column spacer
import 'package:flutter/material.dart';
class ColumnDemo extends StatelessWidget {
const ColumnDemo({super.key});
@override
Widget build(BuildContext context) {
return Column(
textDirection: TextDirection.ltr,
crossAxisAlignment: CrossAxisAlignment.center, // Positionnement horizontal
@Chralu
Chralu / main.dart
Last active September 21, 2022 15:00
Flutter101 - Class static property
class Logger {
static Logger instance = Logger();
static void debug(String message) => instance.log(
level: "DEBUG",
message: message,
);
static void info(String message) => instance.log(
level: "INFO",
@Chralu
Chralu / main.dart
Created September 21, 2022 14:14
Flutter101 - Class getter
const daysInYear = 365;
class Person {
final String firstname;
final String lastname;
final double? weight;
final DateTime birthdate;
Person({
required this.firstname,
@Chralu
Chralu / main.dart
Last active September 21, 2022 14:21
Flutter101 - Class getter
class Person {
static const daysInYear = 365;
final String firstname;
final String lastname;
final double? weight;
final DateTime birthdate;
Person({
required this.firstname,
@Chralu
Chralu / main.dart
Last active September 21, 2022 13:09
Flutter101 - Class portée des propriétés
class Person {
final String firstname;
final String lastname;
final double? weight;
Person({
required this.firstname,
required this.lastname,
this.weight,
});
@Chralu
Chralu / main.dart
Last active September 21, 2022 12:43
Flutter101 - Class simple
class Person {
final String firstname;
final String lastname;
final double? weight;
// Constructeur avec des paramètres
// nommés.
Person({
required this.firstname,
required this.lastname,