Skip to content

Instantly share code, notes, and snippets.

@TahaTesser
TahaTesser / main.dart
Last active June 30, 2024 21:59
MatrixTransition demo with rotateX, rotateY, & rotateZ matrices
import 'dart:math';
import 'package:flutter/material.dart';
import 'package:window_manager/window_manager.dart';
void main() async {
WidgetsFlutterBinding.ensureInitialized();
await windowManager.ensureInitialized();
const WindowOptions windowOptions = WindowOptions(
@realvjy
realvjy / ChoasLinesShader.metal
Last active July 11, 2024 12:40
Choas Lines - Metal Shader
// Lines
float hash( float n ) {
return fract(sin(n)*753.5453123);
}
// Slight modification of iq's noise function.
float noise(vector_float2 x )
{
vector_float2 p = floor(x);
vector_float2 f = fract(x);
import 'package:flutter/material.dart';
const kAnimationDuration = Duration(milliseconds: 350);
class HomeScreen extends StatefulWidget {
const HomeScreen({Key? key}) : super(key: key);
@override
_HomeScreenState createState() => _HomeScreenState();
}
@filiph
filiph / main.dart
Last active October 11, 2022 13:21
Fading Scroller (naive implementation in Flutter)
// The accompanying tweet (incl. video) is here:
// https://twitter.com/filiphracek/status/1494213873422974978
import 'package:flutter/material.dart';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
@dileepadev
dileepadev / .gitignore
Last active December 30, 2023 22:37
.gitignore for Flutter projects
### ------------------------- Flutter.gitignore ------------------------ ###
# Miscellaneous
*.class
#*.lock
*.log
*.pyc
*.swp
.DS_Store
.atom/
@rydmike
rydmike / main.dart
Last active December 23, 2022 12:22
Flutter width constrained body with app theming demo
// MIT License
//
// Copyright (c) 2021 Mike Rydstrom
//
// 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:
@filiph
filiph / main.dart
Last active October 11, 2022 13:23
Human Life Counter
// This now lives in https://github.com/filiph/human-life/blob/main/lib/main.dart as source
// and at https://filiph.github.io/human-life/ as an app.
import 'dart:math';
import 'package:flutter/material.dart';
void main() {
runApp(HumanLifeApp());
}
@rydmike
rydmike / analysis_options.yaml
Last active June 3, 2024 22:02
RydMike lints v2.2.0 - Personal preferences and starting point for Dart & Flutter linter rules setup.
# RydMike LINTER Preferences v2.2.0
#
# Get this file here: https://gist.github.com/rydmike/fdb53ddd933c37d20e6f3188a936cd4c
#
# We include and activate all lint rules, later below we disable the not used or desired ones.
# You can find a list of all lint rules to put in your all_lint_rules.yaml file here:
# https://dart.dev/tools/linter-rules/all
#
# For a comparison of all lint rules settings in rule styles listed below, please see this Google
# sheet: https://docs.google.com/spreadsheets/d/1Nc1gFjmCOMubWZD7f2E4fLhWN7LYaOE__tsA7bf2NjA
@iksent
iksent / Confirm.php
Created August 13, 2020 11:10
Directus Public User Registration (+ Email Confirmation!)
<?php
require_once __DIR__ . '/SignupConfig.php';
use Directus\Application\Application;
use Directus\Application\Http\Request;
use Directus\Application\Http\Response;
use Directus\Authentication\Exception\ExpiredRequestTokenException;
use Directus\Authentication\Exception\InvalidTokenException;
use Directus\Util\JWTUtils;
@apiraino
apiraino / AuthService.php
Last active March 31, 2020 19:09
Simple static token authentication with Directus API
<?php
declare(strict_types=1);
use Directus\Services\AuthService as DirectusAuthService;
use Directus\Authentication\Exception\UserNotFoundException;
class AuthService
{
private function getToken($req)