The following examples are written from the perspective of an engineer who writes code using the Go programming language, and so you'll find that I've written notes about how Rust is different and I don't really cover the why or how of the example Go code. Additionally, the Go examples are far from exhaustive because I'm using this as a 'scratch pad' for my Rust learnings.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Show hidden characters
{ | |
// =================== | |
// THEME CONFIGURATION | |
// =================== | |
// Light-themes | |
// ------------ | |
// "vim.highlightedyank.color": "#2f2f2f25", | |
// "vim.highlightedyank.textColor": "#000000", | |
// "editor.fontWeight": "600", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Script for converting Fedora (and maybe other dracut-based) LiveCD to LiveUSB | |
# with persistence. Only UEFI boot supported. Tested with Fedora 37. | |
# | |
# Usage: | |
# ./fedora_to_usb.sh path/to/mounted/livecd /dev/sdX | |
# | |
# Result USB partitioning: | |
# GPT, 2 partitions: | |
# - "EFI" (vfat 256MB) for GRUB and kernel |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'dart:convert'; | |
import 'dart:io'; | |
import 'dart:typed_data'; | |
import 'dart:ui' as ui; | |
import 'package:flutter/material.dart'; | |
import 'package:flutter/rendering.dart'; | |
import 'package:nft/services/safety/base_stateful.dart'; | |
import 'package:nft/widgets/p_appbar_transparency.dart'; | |
import 'package:path_provider/path_provider.dart'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'dart:ui'; | |
import 'package:flutter/material.dart'; | |
import 'dart:math'; | |
const double kBoidVelocity = 5.0; | |
const double kBoidScale = 2.0; | |
const int kBoidCount = 100; | |
const double kBoidMaxAvoidSteerSpeed = .1; | |
// Angles above maxAlignAngle are treeted the same (caps the turn speed). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
"github.com/dgrijalva/jwt-go" | |
"github.com/go-redis/redis/v7" | |
"github.com/twinj/uuid" | |
"net/http" | |
"os" | |
"strconv" |
Download emacs-w64 and extract somewhere, e.g. a tools
or apps
folder like C:\Users\<user>\tools\emacs
.
Emacs and many other applications store its configuration in the user's "home" folder. Translated directly from the Unix world, that is %UserProfile%
(C:\Users\<user>
), but Windows prefers %AppData%
instead (C:\Users\<user>\AppData\Roaming
).
For simplicity's sake, override this by specifying the HOME
environment variable explicitly. Emacs and some other applications (e.g. MinGW) lets this override the default.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset="utf-8" /> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge" /> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | |
<meta name="scaffolded-by" content="https://github.com/google/stagehand" /> | |
<title>webassembly_example</title> | |
<link rel="stylesheet" href="styles.css" /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# create exchange | |
curl -i -u guest:guest -H "content-type:application/json" \ | |
-XPUT -d'{"type":"fanout","durable":true}' \ | |
http://localhost:15672/api/exchanges/%2f/my.exchange.name | |
# create queue | |
curl -i -u guest:guest -H "content-type:application/json" \ | |
-XPUT -d'{"durable":true,"arguments":{"x-dead-letter-exchange":"", "x-dead-letter-routing-key": "my.queue.dead-letter"}}' \ | |
http://localhost:15672/api/queues/%2f/my.queue |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import 'package:flutter/material.dart'; | |
import 'package:rect_getter/rect_getter.dart'; | |
void main() => runApp(MyApp()); | |
class MyApp extends StatelessWidget { | |
@override | |
Widget build(BuildContext context) { | |
return MaterialApp( | |
title: 'Fab overlay transition', |
NewerOlder