Building a Mac app with Flutter? You need this property set in both of the following entitlement files in order for network access to work.
<key>com.apple.security.network.client</key>
<true/>
// https://go.dev/play/p/61na-PNoubu | |
// | |
// Solving an interface problem: | |
// | |
// I want to abstract my database operations as much as possible, but of | |
// course I need to get my real types back in the end. | |
// | |
// Solution: have a thin wrapper per type that calls the interface-returning | |
// func and then type-asserts everything and returns a new slice of typed | |
// pointers. |
// This is completely fucking insane, Tim Cook, do you realize that? | |
// | |
// Problem: images above some arbitrary, undocumented size blow out the | |
// alignment of downstream views in a NavigationStack. | |
// | |
// Solution: force the NavigationStack itself, and the views inside it, | |
// to fill the available space of their parent views. | |
// | |
// This kinda-sorta makes sense, but also implies that the NavigationStack | |
// *and* its views are displaying as inline by default, even though in this |
// A simple demo of provider and shared_preferences based on the Example app. | |
// | |
// NOTE: this does not work in dartpad.dev, presumably due to a lack of | |
// support for shared_preferences. | |
import 'package:flutter/foundation.dart'; | |
import 'package:flutter/material.dart'; | |
import 'package:provider/provider.dart'; | |
import 'package:shared_preferences/shared_preferences.dart'; |
# parse Ansible .INI dialect | |
import configparser | |
file = "inventory.ini" | |
limit = "test" | |
# Note the kwargs here: | |
config = configparser.ConfigParser(inline_comment_prefixes=["#"],allow_no_value=True) | |
try: | |
config.read(file) |
(dear internet search deities, please let the next person with this problem find this gist quickly)
Again, that is nebari grafana username and password for login auth --
user: admin
pass: prom-operator
This is for: https://{your-domain-from-config}/monitoring/login
-- Convert a UUID that is really a ULID into its standard ULID string representation. | |
-- based on https://pkg.go.dev/github.com/oklog/ulid/v2 | |
CREATE OR REPLACE FUNCTION uuid_to_ulid(uuid) | |
RETURNS text | |
AS $$ | |
DECLARE | |
v BYTEA; | |
t TEXT; | |
enc TEXT = '0123456789ABCDEFGHJKMNPQRSTVWXYZ'; | |
BEGIN |
// Reference to field of reference. | |
// | |
// https://go.dev/play/p/WnM_WH49P7v | |
package main | |
import "fmt" | |
type X struct { | |
Z string |
package main | |
import ( | |
"net/http" | |
) | |
func main() { | |
http.Handle("/", http.FileServer(http.Dir("test/testdata"))) |