Skip to content

Instantly share code, notes, and snippets.

@jferris
jferris / configmap.yaml
Last active October 28, 2024 01:42
Rails Kubernetes Manifests
apiVersion: v1
kind: ConfigMap
metadata:
name: example
namespace: default
data:
APPLICATION_HOST: example.com
LANG: en_US.UTF-8
PIDFILE: /tmp/server.pid
PORT: "3000"
@mayneyao
mayneyao / notion2blog.js
Last active September 14, 2024 01:22
Notion.so > Personal Blog | custom domain + disqus comment
const MY_DOMAIN = "agodrich.com"
const START_PAGE = "https://www.notion.so/gatsby-starter-notion-2c5e3d685aa341088d4cd8daca52fcc2"
const DISQUS_SHORTNAME = "agodrich"
addEventListener('fetch', event => {
event.respondWith(fetchAndApply(event.request))
})
const corsHeaders = {
"Access-Control-Allow-Origin": "*",
@WebReflection
WebReflection / why-i-use-web-components.md
Last active October 18, 2024 10:55
Why I use web components

Why I use web components

This is some sort of answer to recent posts regarding Web Components, where more than a few misconceptions were delivered as fact.

Let's start by defining what we are talking about.

The Web Components Umbrella

As you can read in the dedicated GitHub page, Web Components is a group of features, where each feature works already by itself, and it doesn't need other features of the group to be already usable, or useful.

@rkbalgi
rkbalgi / custom_types.go
Last active July 11, 2024 12:41
Using custom types with cel-go
package test
//A very simple example of using user defined structures with instance functions with cel-go
import (
"github.com/google/cel-go/cel"
"github.com/google/cel-go/checker/decls"
"github.com/google/cel-go/common/types"
"github.com/google/cel-go/common/types/ref"
"github.com/google/cel-go/common/types/traits"
import 'dart:math' as math;
import 'package:flutter/material.dart';
import 'package:flutter/rendering.dart';
import 'package:flutter/scheduler.dart';
void main() => runApp(ExampleApp());
class ExampleApp extends StatelessWidget {
@override
import 'package:flutter/material.dart';
class ABCModel extends InheritedModel<String> {
ABCModel({
Key key,
this.a,
this.b,
this.c,
Widget child,
}) : super(key: key, child: child);
import 'package:flutter/material.dart';
// This class is a simulacrum of an internally complex opaque data object,
// whose values can only be retrieved via path lookup.
class IntegerTree {
int _a = 0;
int _b = 1;
int _c = 2;
int valueOf(String path) => path == 'a' ? _a : (path == 'b' ? _b : _c);
@mjohnsullivan
mjohnsullivan / scroll_detection.dart
Created July 11, 2018 17:13
Detect when a scrollable widget starts or stops scrolling
// Copyright 2018 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
import 'package:flutter/material.dart';
void main() => runApp(MyApp());
class MyApp extends StatelessWidget {
@override
@markerikson
markerikson / redux-archeology-notes.md
Last active November 17, 2020 04:54
Redux Archeology and Design Notes

Design Goals

reduxjs/redux#8 (comment)

The main goal of this library is to prove that Flux can be implemented in a way compatible with full hot reloading (and explore how this can be done). You can run the example code with npm start, change action creators or stores, and the new logic will kick in before you refresh.

// Should pass the Locale from Localizations to Text/RichText/etc to painting.TextStyle to ui.TextStyle
// https://github.com/flutter/flutter/issues/16408
import 'package:flutter/material.dart';
import 'package:flutter_localizations/flutter_localizations.dart';
// See also:
// problem description - https://medium.com/@najeira/flutter-and-cjk-font-selection-5dbc6a6164ba
// problem character - http://unicode.org/cldr/utility/character.jsp?a=6B21