Skip to content

Instantly share code, notes, and snippets.

Avatar

Edoardo Ceccarelli edoardoc

View GitHub Profile
@edoardoc
edoardoc / resetBattery.nsh
Created Oct 13, 2022
a quick script to reset the battery usage for a Star LabTop MK III, to be put in /boot/efi/EFI/ and launched from a UEFI shell
View resetBattery.nsh
mm -io 66 1
stall 1000
mm -io 66 81 -W 1
stall 1000
mm -io 66 1
@edoardoc
edoardoc / plpgsql_query_function_template.sql
Created Dec 10, 2021
PL/pgSQL Template to run inline a complicated function and get results in console
View plpgsql_query_function_template.sql
-- PL/pgSQL Template to run inline a complicated function and get results in console
DO $$
DECLARE
-- ADD QUERY DECLARATION HERE:
filteringIdOfSomeKind UUID;
-- ADD QUERY DECLARATION HERE -- END!
t timestamptz;
target record;
@edoardoc
edoardoc / RawAutocompleteEddy.dart
Last active Apr 9, 2021
my take at the standard flutter autocomplete while unmarshaling a json with a custom type
View RawAutocompleteEddy.dart
import 'dart:convert';
import 'package:flutter/material.dart';
class RawAutocompleteEddy extends StatelessWidget {
const RawAutocompleteEddy({Key? key}) : super(key: key);
@override
Widget build(BuildContext context) {
return MaterialApp(
home: Scaffold(
View eclipse-formatter.xml
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<profiles version="13">
<profile kind="CodeFormatterProfile" name="Eclipse" version="13">
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_ellipsis" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_new_line_in_empty_annotation_declaration" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression" value="do not insert"/>
<setting id="org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration" value="insert"/>
<setting id="org.eclipse.jdt.core.formatter.parentheses_positions_in_for_statment" value="common_lines"/>
<setting id="org.eclipse.jdt.core.formatter.comment.new_lines_at_block_boundaries" value="true"/>
View titoli.sh
#!/bin/bash
function wwwt {
echo URL: $1
echo TITLE: $(curl -s $1 | grep -o "<title>[^<]*" | tail -c+8)
echo
}
wwwt 'https://wwwocean.portaportese.it/rubriche/Veicoli/Auto_italiane/Fiat/m-500-mD098'
wwwt 'https://wwwocean.portaportese.it/rubriche/Veicoli/Auto_straniere/Bmw/m-x3-tADmD180'