Skip to content

Instantly share code, notes, and snippets.

View esouthren's full-sized avatar

Eilidh Southren esouthren

  • London
View GitHub Profile
import 'package:flutter/material.dart';
const Color darkBlue = Color.fromARGB(255, 18, 32, 47);
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
@override
@esouthren
esouthren / main.dart
Created February 6, 2023 12:08
list tile icon buttons
// Copyright 2014 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// Flutter code sample for [TextFormField].
import 'package:flutter/material.dart';
void main() => runApp(const MyApp());
@esouthren
esouthren / main.dart
Created February 3, 2023 12:28
TextField icons
// Copyright 2014 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// Flutter code sample for [TextFormField].
import 'package:flutter/material.dart';
import 'package:flutter/services.dart';
void main() => runApp(const MyApp());
@esouthren
esouthren / main.dart
Created January 16, 2023 14:10
TextField disabled example
// Copyright 2014 The Flutter Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// Flutter code sample for [TextFormField].
import 'package:flutter/material.dart';
void main() => runApp(const MyApp());
@esouthren
esouthren / main.dart
Created January 12, 2023 12:10
M3 Checkbox error sides
import 'package:flutter/material.dart';
void main() => runApp(const MyApp());
class MyApp extends StatelessWidget {
const MyApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
@esouthren
esouthren / main.dart
Created January 3, 2023 18:38
AppBar icon override
import 'package:flutter/material.dart';
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
final theme = ThemeData.light(useMaterial3: true);
void main() {
void runTestCases(Function scoringFunction) {
print(scoringFunction(1, 1) == 'Player 1: fifteen, Player 2: fifteen'
? 'passes'
: 'fail: output = ${scoringFunction(1, 1)}');
print(scoringFunction(3, 0) == 'Player 1: forty, Player 2: love'
? 'passes'
: 'fail: output = ${scoringFunction(3, 0)}');
print(scoringFunction(4, 4) == 'Deuce'
? 'passes'
@esouthren
esouthren / hofstadter_sentences
Created January 10, 2021 16:29
Hofstadter's Sentences
#!/usr/bin/python
# -*- coding: utf-8 -*-
# Metamagical Themas, Douglas R Hofstadter
# Self-Referential Sentences: a follow up
#
# The noted logician Raphael Robinson submitted a playful puzzle
# in the self documenting genre. Readers are asked to complete
# the following sentence:
#
# "In this sentence, the number of occurrences of 0 is _, of 1
@esouthren
esouthren / index.js
Created May 7, 2020 12:09
Hacking with Amazon Alexa
/*
* Copyright 2018-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
* A copy of the License is located at
* http://www.apache.org/licenses/LICENSE-2.0
*
* or in the "license" file accompanying this file. This file is distributed
* on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
* express or implied. See the License for the specific language governing
transposit.runOperation('get_a_commit', {owner: user, repo: repo}).then((response) => {
if (response.status !== "SUCCESS") {
console.log(response);
throw response;
}