Skip to content

Instantly share code, notes, and snippets.

View gerfalcon's full-sized avatar

Csongor Vogel gerfalcon

View GitHub Profile
@gerfalcon
gerfalcon / main.dart
Created February 20, 2026 12:36
Money library floating-point precision proof - PR #26215
// Proof: Amount.of(num) propagates floating-point imprecision
// The money library does: Decimal.parse(value.toString())
// This demonstrates that toString() does NOT always produce clean strings.
//
// Run on DartPad or locally: dart run main.dart
void main() {
print('=== FLOATING-POINT PRECISION PROOF ===');
print('Testing: Amount.of(num) internally does Decimal.parse(value.toString())');
print('So the question is: does toString() produce a "clean" string?\n');
@gerfalcon
gerfalcon / plan.md
Last active November 15, 2025 22:42
DevFest Dubai - Gemini CLI workshop prompt

You are a senior web developer. Create a simple quiz app with three new files: index.html, style.css, and app.js.

Quiz Content:

The quiz will have the following questions:

  1. How can you enable both packaged MCPs (Modular Command Processors) and local Context files for a project in the Gemini CLI?
    • By using the /extensions command with the --mcp and --context flags. (Correct)
    • By manually editing the GEMINI.md file.
  • By using the /tools command to add them.
import 'package:flutter/material.dart';
/// Star rating widget
///
/// Needs to have:
/// - hover,
/// -
/// - input: Rating value [1, 5] - nullable
/// - preview for example with a grey color, and no confirmatio
/// MaterialStateProperties - to handle the hower and other effects -
const button = fixture.nativeElement.querySelector('button');
fixture.nativeElement.querySelector('input').value = 'A new title';
const inputText = fixture.nativeElement.querySelector('input').value;
button.click();
fixture.detectChanges();
expect(component.changeTitleEvent.emit).toHaveBeenCalledWith(inputText);
const fixture = TestBed.createComponent(AppComponent);
fixture.detectChanges();
const compiled = fixture.debugElement.nativeElement;
expect(compiled.querySelector('h1').textContent).toContain('Welcome to angular-component-testing!');
const fixture = TestBed.createComponent(AppComponent);
const app = fixture.debugElement.componentInstance;
expect(app.title).toEqual('angular-component-testing');
beforeEach(async(() => {
TestBed.configureTestingModule({
declarations: [
AppComponent
],
}).compileComponents();
}));
const kTabletBreakpoint = 768;
const kDesktopBreakpoint = 1440;
class ResponsiveLayout extends StatelessWidget {
const ResponsiveLayout({
required this.mobileBody,
this.tabletBody,
this.desktopBody,
});
final _containerSize = 200.0, _spacing = 30.0, _breakPoint = 1000.0;
LayoutBuilder(
builder: (BuildContext context, BoxConstraints constraints) {
return Center(
child: Padding(
padding: const EdgeInsets.symmetric(horizontal: 32),
child: Flex(
mainAxisAlignment: MainAxisAlignment.center,
direction: constraints.maxWidth > _breakPoint
@media (max-width: 600px) {
.main {
background-color: red;
}
}