Skip to content

Instantly share code, notes, and snippets.

View wilsonowilson's full-sized avatar
🌟
Dreaming in Dart

Wilson Wilson wilsonowilson

🌟
Dreaming in Dart
View GitHub Profile
@wilsonowilson
wilsonowilson / gist:a25d8d30886c4bcf12d7c1ac9e497ce8
Last active February 26, 2021 16:25
RenderObject Swipe Card
import 'dart:math';
import 'package:flutter/gestures.dart';
import 'package:flutter/material.dart';
import 'package:flutter/rendering.dart';
const numbers = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10];
class FlipCardPlayground extends StatelessWidget {
@override
@wilsonowilson
wilsonowilson / distortion.dart
Created March 17, 2021 19:05
Widget warping and distortion in Flutter
import 'dart:typed_data';
import 'dart:ui' hide Image;
import 'package:image/image.dart' as img_lib;
import 'dart:math' as math;
import 'package:flutter/material.dart';
import 'package:flutter/rendering.dart';
enum ImageFetchState { initial, fetching, fetched }
class ImagePlayground extends StatefulWidget {
@wilsonowilson
wilsonowilson / index.html
Created July 8, 2021 18:41
Swapping web renderers at runtime
<body>
<script src="js/renderer_switcher.js"></script>
<script>
<!-- Service worker code -->
<!-- This script installs service_worker.js to provide PWA functionality to application. For more information, see: https://developers.google.com/web/fundamentals/primers/service-workers -->
...
@wilsonowilson
wilsonowilson / main.dart
Created July 9, 2021 22:03
Missing emojis on canvaskit example
import 'package:flutter/material.dart';
void main() {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({Key? key}) : super(key: key);
@override
@wilsonowilson
wilsonowilson / index.svelte
Created June 29, 2022 17:26
Paddle Stripe-Style Checkout
<script context="module" lang="ts">
import { getSubscriptionPlan } from '$lib/billing/api';
import { Account, getInitialUser, SubscriptionPlan } from '$lib/core/api';
export const router = false;
import type { Load } from '@sveltejs/kit';
import { onMount } from 'svelte';
export const load: Load = async ({ params }) => {
const id = params.planId;
const result = await getSubscriptionPlan(id);
if (result.isErr()) {
@wilsonowilson
wilsonowilson / ImagePicker.svelte
Created February 6, 2023 08:38
Svelte + Tailwind Image Picker
<script lang="ts">
import { toast } from "../utils/toast";
import Icon from "../components/Icon.svelte";
import { ImagePlus, X } from "../components/icons";
import Label from "../components/Label.svelte";
import FileDrop from "filedrop-svelte";
import { scale } from "svelte/transition";
export let files: File[] = [];
@wilsonowilson
wilsonowilson / preflight.css
Created June 26, 2023 10:08
Tailwind Prefixed Preflight
#your-container *,
#your-container ::before,
#your-container ::after {
box-sizing: border-box;
border-width: 0;
border-style: solid;
border-color: theme("borderColor.DEFAULT", currentColor);
}
#your-container ::before,
@wilsonowilson
wilsonowilson / settings.json
Created January 2, 2024 14:56
Minimal Vscode w/ APC extension
{
"workbench.colorTheme": "Aura Dark",
"workbench.iconTheme": "material-icon-theme",
"editor.fontFamily": "'Geist Mono', Menlo, Monaco, 'Courier New', monospace",
"apc.listRow": {
"height": 24,
"fontSize": 11
},
"window.titleBarStyle": "native",
"apc.font.family": "Geist Mono",
@wilsonowilson
wilsonowilson / +page.svelte
Last active July 22, 2024 02:26
Setting up ConvertKit Plugin Oauth with Typescript + Firebase
<script lang="ts">
import { page } from '$app/stores';
import { getInitialUser } from '$lib/Identity/api/auth';
import AuthPageLayout from '$lib/Identity/components/AuthPageLayout.svelte';
import InlineLoader from '@senja/shared/components/InlineLoader.svelte';
import TertiaryButton from '@senja/shared/components/TertiaryButton.svelte';
import { ConvertkitIcon } from '@senja/shared/components/icons/integrations';
import { optimizeImage } from '@senja/shared/utils/cdn';
// This is the first URL ConvertKit will call. It'll contain a redirect URL, a <state> parameter and a client_id.