Created with <3 with dartpad.dev.
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'; | |
const Color darkBlue = Color.fromARGB(255, 18, 32, 47); | |
void main() { | |
runApp(MyApp()); | |
} | |
class MyApp extends StatelessWidget { | |
@override |
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:math'; | |
void main() { | |
var rng = Random(); | |
List<List<int>> integers = List.generate( | |
15, (int i) => List.generate(5, (int j) => rng.nextInt(89)+10)); | |
print(integers); | |
for (var L in integers) { | |
print(L.map((i) => [i, L.indexOf(i)]).toList()); | |
} |
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'; | |
/* | |
* Tap/click the floating action button to scroll the horizontal ListView, and hover the first ListTile. | |
* It is hilghlighted, but the highlighted portion is shown hover/under the left vertical ListView. | |
*/ | |
void main() { | |
runApp(const MyApp()); | |
} | |
class MyApp extends StatelessWidget { |
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
#!/usr/bin/env python3 | |
import threading | |
import queue | |
import argparse | |
import os.path | |
import sys | |
NUM_WORKER_THREADS = 16 | |
LUKS_HEADER = b'LUKS\xba\xbe' |
Enable i2c RTC using systemd.
A udev rules triggers an I2C systemd service on I2C kernel module adding.
Service then loads I2C driver adding a new I2C device to /sys
Then kernel loads I2C RTC driver and adds an RTC device
It triggers a udev rules that updates hardware clock
- enable I2C in config.txt, adding
device_tree_param=i2c1=on
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 | |
set -e | |
export IFS=' | |
' | |
# that's a dangerous script to run because it removes all your snaps. Don't do that | |
function echo_cmd() { | |
echo "$@" | |
#$@ | |
} |
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"> | |
<title>padv</title> | |
<meta name='description' content="A page showing results from wigle.net API"> | |
<meta name="viewport" content="width=device-width, initial-scale=1"> | |
<link rel="shortcut icon" type="image/x-icon" href="favicon.ico"> | |
<link rel="stylesheet" href="https://unpkg.com/[email protected]/dist/leaflet.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
#!/usr/bin/python3 | |
import sys | |
import re | |
import os | |
import mailbox | |
def convert(maildir, mbox_name): | |
mbox = mailbox.mbox(mbox_name) |