Skip to content

Instantly share code, notes, and snippets.

@slightfoot
slightfoot / name_tagging.dart
Last active December 9, 2023 17:01
Name Tagging during input example - by Simon Lightfoot - Humpday Q&A :: 6th December 2023 #Flutter #Dart - https://www.youtube.com/live/TaHhT1QdYUM?t=4057
// MIT License
//
// Copyright (c) 2023 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:
@Kavantix
Kavantix / simple_isolate.dart
Last active February 3, 2022 13:38
Simple dart 2.15 compute implementation
import 'dart:async';
import 'dart:isolate';
Future<R> compute<I, R>(R Function(I) f, I input,
{String debugName = ''}) async {
final resultPort = ReceivePort();
final args = _ComputeArgs<I, R>(resultPort.sendPort, f, input);
final isolate = await Isolate.spawn<_ComputeArgs<I, R>>(
_compute,
args,
@rohan20
rohan20 / flutter_google_maps_bottom_sheet.dart
Last active July 4, 2023 15:38
Flutter Google Maps Bottom Sheet
import 'package:flutter/material.dart';
class GoogleMapsClonePage extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Scaffold(
body: Stack(
children: <Widget>[
CustomGoogleMap(),
CustomHeader(),
@jterral
jterral / azure-pipelines__ios__.yaml
Last active January 21, 2024 09:34
Azure Pipelines to build and deploy iOS appplication with AppCenter
#
# Azure Pipelines
trigger:
batch: true
name: $(Build.BuildId)_$(SourceBranchName)_$(Date:yyyyMMdd)$(Rev:.r)
variables:
- group: my-group-var
@slightfoot
slightfoot / media_query_extension.dart
Last active July 29, 2021 13:32
Media Query Extension - by Simon Lightfoot
// MIT License
//
// Copyright (c) 2020 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:
@micimize
micimize / scirm.dart
Created December 25, 2019 17:58
Simple flutter scrim/overlay widget
class Scrim extends StatelessWidget {
final bool applied;
final Widget child;
final double opacity;
final Duration speed;
final Color color;
const Scrim({
Key key,
@slightfoot
slightfoot / main.dart
Last active June 19, 2022 11:15
Firebase Login/Logout Example - by Simon Lightfoot
/*
This example uses the following packages:
firebase_auth: 0.14.0+5
google_sign_in: 4.0.7
provider: 3.1.0+1
Make sure you have setup your project with Firebase by following these instructions:
1. Follow Option 1 instructions here up to Step 3
@steven2358
steven2358 / ffmpeg.md
Last active May 5, 2024 12:45
FFmpeg cheat sheet
func filterVideo(inputFilePath: String, outputFilePath: String,
filterPath: String, callback: @escaping (Bool) -> Void) -> (Process, DispatchWorkItem)? {
guard let launchPath = Bundle.main.path(forResource: "ffmpeg", ofType: "") else {
return nil
}
let process = Process()
let task = DispatchWorkItem {
process.launchPath = launchPath
process.arguments = [
"-y",
@Seasons7
Seasons7 / nstask.swift
Created July 22, 2015 19:21
NSTask Sample for Swift
import Cocoa
import Foundation
var str = "Hello, playground"
var task:NSTask = NSTask()
var pipe:NSPipe = NSPipe()
task.launchPath = "/bin/ls"
task.arguments = ["-la"]