Skip to content

Instantly share code, notes, and snippets.

View Rahiche's full-sized avatar
🏠
Working from home

Raouf Rahiche Rahiche

🏠
Working from home
View GitHub Profile
@aras-p
aras-p / preprocessor_fun.h
Last active July 16, 2024 02:50
Things to commit just before leaving your job
// Just before switching jobs:
// Add one of these.
// Preferably into the same commit where you do a large merge.
//
// This started as a tweet with a joke of "C++ pro-tip: #define private public",
// and then it quickly escalated into more and more evil suggestions.
// I've tried to capture interesting suggestions here.
//
// Contributors: @r2d2rigo, @joeldevahl, @msinilo, @_Humus_,
// @YuriyODonnell, @rygorous, @cmuratori, @mike_acton, @grumpygiant,
@chinmaygarde
chinmaygarde / FlutterEmbedderGLFW.cc
Last active November 23, 2023 16:26
Flutter Embedder API Example (GLFW with OpenGL)
#include <assert.h>
#include <chrono>
#include <embedder.h>
#include <glfw3.h>
#include <iostream>
static_assert(FLUTTER_ENGINE_VERSION == 1, "");
static const size_t kInitialWindowWidth = 800;
@jeroen-meijer
jeroen-meijer / flutterrepair.sh
Last active August 23, 2023 04:05
Flutter Repair iOS - When your Flutter build comes up with weird Xcode errors, run this script from your Flutter project directory and it will clean out all the old iOS stuff and get your project dependencies fresh.
#!/bin/sh
# To run, download the script or copy the code to a '.sh' file (for example 'flutterrepair.sh') and run like any other script:
# sh ./flutterrepair.sh
# or
# sudo sh flutterrepair.sh
echo "Flutter Repair (by jeroen-meijer on GitHubGist)"
echo Cleaning project...
import 'package:flutter/material.dart';
class ABCModel extends InheritedModel<String> {
ABCModel({
Key key,
this.a,
this.b,
this.c,
Widget child,
}) : super(key: key, child: child);
@Rahiche
Rahiche / flutter Scroll Controller
Created August 10, 2018 20:59
How to scroll to the beginning / end of the ListView
import 'package:flutter/material.dart';
void main() => runApp(MaterialApp(home: new MyApp()));
class MyApp extends StatefulWidget {
@override
_MyAppState createState() => _MyAppState();
}
class _MyAppState extends State<MyApp> {
import 'package:flutter/material.dart';
void main() => runApp(MaterialApp(
theme: ThemeData(primaryColor: Colors.tealAccent), home: new MyApp()));
class MyApp extends StatefulWidget {
@override
_MyAppState createState() => _MyAppState();
}
import 'package:flutter/material.dart';
void main() => runApp(MaterialApp(home: new MyApp()));
class MyApp extends StatefulWidget {
@override
_MyAppState createState() => _MyAppState();
}
class _MyAppState extends State<MyApp> {
// MIT License
//
// Copyright (c) 2019 Simon Lightfoot
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
@slightfoot
slightfoot / charts.dart
Created October 10, 2018 20:10
Charts Demo - 10th October 2018 - #HumpdayQandA
import 'dart:math';
import 'package:flutter/material.dart';
void main() => runApp(ChartsDemoApp());
class ChartsDemoApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
@slightfoot
slightfoot / custom_appbar.dart
Created November 21, 2018 21:36
Custom AppBar - 21th November 2018 - #HumpdayQandA
import 'package:flutter/material.dart';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'HumpDayQandA 21st',
theme: ThemeData.light(),