Skip to content

Instantly share code, notes, and snippets.

@MohamedAlaa
MohamedAlaa / tmux-cheatsheet.markdown
Last active July 7, 2024 07:28
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@kasperpeulen
kasperpeulen / README.md
Last active June 6, 2024 10:54
How to pretty-print JSON using Dart.
library mirrors.src.decode;
import 'dart:mirrors' as mirrors;
import 'dart:convert';
/// Create an object of the given type [t] from the given JSON string.
decode(String json, Type t) {
// Get deserialization descriptor for the given type.
// This descriptor describes how to handle the type and all its fields.
final TypeDesc desc = getDesc(t);
@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;
@brianegan
brianegan / spinnies2.dart
Created January 21, 2019 17:43
Shows how to create some funky spinners
import 'dart:math' show pi;
import 'package:flutter/material.dart';
/// A Widget that can be configured to show funky spinning rectangles!
///
/// ### Usage
///
/// ```
/// Spinnies(
@slightfoot
slightfoot / dropdown_popup.dart
Last active August 30, 2021 06:33
Custom Dropdown Popup Menu Example - Custom Enum, Theming, Extending Existing API, Animations, Transitions, Routes, Custom shadows, borders and painting. Based on https://dribbble.com/shots/2369431-Daily-UI-027-Dropdown
import 'package:flutter/material.dart';
import 'package:flutter/widgets.dart';
import 'package:vector_math/vector_math_64.dart' show radians;
void main() => runApp(ExampleApp());
class ExampleItem {
static const Pineapples = ExampleItem._('Pineapples');
static const Watermelons = ExampleItem._('Watermelons');
static const StarFruit = ExampleItem._('Star Fruit');
@ajinasokan
ajinasokan / flutter_desktop_macos.md
Last active November 22, 2019 14:38
Run Flutter apps in MacOS with IDE support and hot reloading

This setup is only for MacOS. I don't have a windows/linux machine to test.

Clone FDE repo

cd ~
git clone https://github.com/google/flutter-desktop-embedding

Switch to flutter master

@dnys1
dnys1 / dots_indicator.dart
Created July 26, 2019 03:58
Carousel widget in Flutter
import 'dart:math';
import 'package:flutter/material.dart';
class DotsIndicator extends AnimatedWidget {
const DotsIndicator({
@required this.controller,
@required this.itemCount,
@required this.onPageSelected,
this.color = Colors.white,
@webianks
webianks / main.dart
Created August 23, 2019 11:32
Scanning Animation In Flutter
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:scanning_aimation/scanner.dart';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
@slightfoot
slightfoot / multi_select.dart
Last active August 3, 2023 18:10
Multi Select GridView in Flutter - by Simon Lightfoot (Drag to select multiple items) Try now here: https://dartpad.dev/?id=a002dd1e031f5f012f810c6d5da14a11
// 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: