Skip to content

Instantly share code, notes, and snippets.

import 'package:flutter/material.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({super.key});
@override
enum Color { red, blue, green }
void main() {
final color = Color.red;
switch (color) {
Color.red => "red",
Color.blue => "blue",
Color.green => "green",
};
}
import 'dart:math';
import 'package:flutter/material.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({super.key});
import 'dart:math';
import 'package:flutter/material.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({super.key});
import 'dart:math';
import 'package:flutter/material.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({super.key});
openapi: 3.0.3
info:
title: "uploadCloudStorage"
description: "creates and uploads a text file to Cloud Storage"
version: "1.0"
paths:
/:
post:
summary: "creates and uploads a text file to Cloud Storage"
description: ""
@your-diary
your-diary / checkNewMails.ts
Created July 13, 2022 16:01
gas to check new gmails
function f() {
const newMails = checkNewMail();
//arbitrary operation
newMails.forEach(console.log);
}
function checkNewMail(): GoogleAppsScript.Gmail.GmailMessage[] {
@your-diary
your-diary / euler_conjecture_disprover.py
Last active July 18, 2021 06:08
Exhaustive search to find the solution for `i^5 + j^5 + k^5 + l^5 = z^5`, known as Euler's conjecture.
#!/usr/bin/env python3
#Exhaustive search to find the solution for `i^5 + j^5 + k^5 + l^5 = z^5`, known as Euler's conjecture.
#According to |https://www.math.uci.edu/~brusso/stewart230-231.pdf|, one of the solution is first found in 1966 by exhaustive search.
#Complexity (real, M1 mac): 2.57e-07 * n^3
import math
import sys
import time
@your-diary
your-diary / youtube_show_latency.user.js
Last active January 26, 2021 09:08
Shows the latency for a YouTube live stream.
// ==UserScript==
// @name [YouTube] Shows latency.
// @description Shows latency.
// @match https://www.youtube.com/watch?v=*
// @namespace ynn
// ==/UserScript==
(function() {
"use strict";