Skip to content

Instantly share code, notes, and snippets.

View Craftplacer's full-sized avatar

Crafti Craftplacer

View GitHub Profile
@Craftplacer
Craftplacer / README.md
Last active April 20, 2024 10:35
Weather app
import 'package:flutter/rendering.dart';
import 'package:flutter/widgets.dart';
class SliverCrossAxisAlign extends SingleChildRenderObjectWidget {
final double alignment;
const SliverCrossAxisAlign({
super.key,
required this.alignment,
required Widget sliver,
import "package:flutter/material.dart";
class ResponsiveMenu extends StatelessWidget {
final Function(BuildContext context, VoidCallback onTap)? builder;
final List<Widget> Function(
BuildContext context,
VoidCallback? onClose,
) itemBuilder;
const AdaptiveMenu({

Utilizing Flutter's testing framework for automatic, accurate screenshots of your app

Every app developer has to submit some kind of screenshot for potential users. This task can be tedious, difficult, time-consuming. Maybe you don't want to setup your app in certain ways so that it works, or looks a specific way.

Flutter is in all regards flexible, it offers great tooling for everything.

So what if, instead of writing tests, we want to create screenshots?

Laying down the foundation

@Craftplacer
Craftplacer / oauth.dart
Last active April 19, 2022 12:16
Dart implementation of https://oauth.net/core/1.0a
import 'dart:convert';
import 'dart:math';
import 'package:crypto/crypto.dart';
import 'package:kaiteki/model/http_method.dart';
final DateTime _epoch = DateTime(1970);
/// Returns the seconds since January 1st 1970, required for the timestamp
/// parameter.
int secondsSinceEpoch() {
@Craftplacer
Craftplacer / Program.cs
Created January 23, 2022 13:07
Mastodon-compatible archiver
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Net.Http.Headers;
using System.Threading.Tasks;
using Newtonsoft.Json;
@Craftplacer
Craftplacer / FuckFandom.txt
Last active July 18, 2024 22:39
Filter for uBlock Origin that removes most of Fandom's elements from a wiki.
![Adblock Plus 2.0]
! Title: FuckFandom
! Expires: 30 days (update frequency)
! Homepage: https://gist.github.com/Craftplacer/04089c2c666c89e10818124c92d9c65b
fandom.com##.mcf-wrapper
fandom.com##.wds-global-footer
fandom.com##.global-navigation
fandom.com##.top-ads-container
@Craftplacer
Craftplacer / Json2Dart.cs
Last active July 24, 2020 18:37
Simple tool for making dart source code out of JSON files. (depends on Newtonsoft.Json and Humanizer)
using System;
using System.IO;
using System.Linq;
using System.Text;
using Humanizer;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
namespace Json2Dart
{