Skip to content

Instantly share code, notes, and snippets.

@dylan-lom
dylan-lom / index.html
Created April 18, 2024 11:25
log.dlom.cc - a self contained "log" web application
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>log.dlom.cc</title>
<style>
.red { color: 'red'; }
img { max-width: 100%; }
li { max-width: 50%; }
@dylan-lom
dylan-lom / all-seeds.csv
Created March 28, 2024 04:11
trowel - diggers.com.au seeds scrape 2024-03-28
We can't make this file beautiful and searchable because it's too large.
common_name,botanical_name,sowing_months,in_library,light_needs,tags,water_needs,seed_sowing_width,plant_type,sowing_method,growing_weeks,description,sku,url,image
"Turnip 'White Mini'","Brassica rapa","April,August,December,July,June,May,November,October,September","Out of Stock","Full Sun","Cool season crops,Fast Growing Winter Crop,Pest Repelling,Root Crops and Friends,Turnip,turnip & swede,Vegetables","Regular Watering","15","Hardy Biennial","Sow direct","7","A tender round white turnip that stores well and offers both edible roots and shoots. The spherical-shaped roots are crisp and ready to harvest in just 7 weeks. A delicate treat; try roasting them whole with a splash of olive oil and serve alongside roasted baby carrots and beef Wellington. Both the turnip and foliage are edible, which is great if your looking for a seasonal green to spice up your winter cuisine. A brassica grown for it's roots rather than shoots, turnips have been grown for around 4000 years and are credited with giving rise to som
@dylan-lom
dylan-lom / monitor.sh
Created March 27, 2024 13:51
trowel - diggers.com.au seed scrape 2024-03-27
alias remaining='echo $((629 - (`wc -l out.csv | cut -d" " -f1` - 18)))'
while [ `remaining` -gt 0 ]; do echo `remaining` remaining; sleep 15; done
#include <string.h>
#include <stdio.h>
int
main(int argc, char **argv)
{
size_t msglen = 2 + argc;
for (int i = 1; i < argc; i++) {
msglen += strlen(argv[i]);
}
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <stdbool.h>
#define FNV_OFFSET_BASIS 0x811c9dc5
#define FNV_PRIME 0x01000193
typedef unsigned int uint;
@dylan-lom
dylan-lom / gist:a30d9f4d4ce4f20611a049f9ef78a1e2
Created December 14, 2021 11:27
Create a new Sql Server 2019 instance in a docker container with the AdventureWorks2019 sample database
#!/usr/bin/env sh
#
# Create a new Sql Server 2019 instance in a docker container
# with the AdventureWorks2019 sample database
set -xe
name="gitsql"
test -d backup || mkdir backup
@dylan-lom
dylan-lom / 01-fixps3.rules
Last active July 26, 2023 20:02
Fake PS3 controller fix & udev rule
DRIVER=="usb", SUBSYSTEM=="usb", ATTR{idVendor}=="045e", ATTR{idProduct}=="028e", RUN+="/usr/local/bin/fixcontroller.py"
mRttRequestHelper = new RttRequestHelper(
mContext,
new RttRangingResultCallback(){
@Override
public void job(List<RangingResult> results) {
// do things
for (RangingResult result: results) {
if (result.getStatus() != RangingResult.STATUS_SUCCESS) {
Log.e(TAG, "Ranging failed with status: " + result.getStatus());
@dylan-lom
dylan-lom / permission.java
Created December 2, 2019 03:33
example android get permission
// declare your constant at the top of class
// list of permissions:
// https://developer.android.com/reference/android/Manifest.permission.html
public void requestPermissions(View view){
// we require the CHANGE_WIFI_STATE permission, request this
if (ContextCompat.checkSelfPermission(this,
Manifest.permission.ACCESS_FINE_LOCATION)
!= PackageManager.PERMISSION_GRANTED) {
Log.e("requestPermissions", "Permission not granted!");
pragma solidity ^0.5.1;
/**
* @title NoteChain
* @dev The NoteChain contract provides functions to store notes in blockchain
*/
contract NoteChain {
// EVENTS