Skip to content

Instantly share code, notes, and snippets.

@andrepcg
andrepcg / temp-domains.txt
Created February 22, 2023 10:26
mailchecker 3.2.14 blocklist
0-mail.com
0815.ru
0clickemail.com
10minutemail.com
20minutemail.com
2prong.com
30minutemail.com
3d-painting.com
4warding.com
4warding.net
import socket
import struct
#Proxy script that receive CoAP message and forward them to Shelly HASS plugin.
#Use this if you have Shelly devices on other sub-net or VLAN
#Require ShellyForHASS 0.0.15 or later
#Change to the ip-address of your HASS server
HASS_IP = "192.168.1.XXX"
@andrepcg
andrepcg / data.txt
Created March 22, 2022 15:55
My test gist
9395b1a6-2888-11ea-b307-71b686771c6a folksam.se ::ffff:83.250.242.30
9395b1a6-2888-11ea-b307-71b686771c6a folksam.se ::ffff:81.228.197.47
9395b1a6-2888-11ea-b307-71b686771c6a folksam.se ::ffff:82.183.52.236
9395b1a6-2888-11ea-b307-71b686771c6a folksam.se ::ffff:88.80.166.189
9395b1a6-2888-11ea-b307-71b686771c6a folksam.se ::ffff:77.53.218.35
9395b1a6-2888-11ea-b307-71b686771c6a folksam.se ::ffff:81.235.35.152
9395b1a6-2888-11ea-b307-71b686771c6a folksam.se ::ffff:46.39.107.146
9395b1a6-2888-11ea-b307-71b686771c6a ::ffff:195.79.157.0/120
4541022c-e190-11e6-bf49-07548a7e5fbb handelsbanken.se ::ffff:13.53.47.110
4541022c-e190-11e6-bf49-07548a7e5fbb handelsbanken.se ::ffff:13.48.36.215
@andrepcg
andrepcg / data.json
Created March 21, 2022 15:33
My test gist
This file has been truncated, but you can view the full file.
@andrepcg
andrepcg / extracao_votacoes_parlamento.rb
Created October 17, 2020 11:29
Extrai resultado das votações na Assembleia da República
Proposal = Struct.new(:title, :votes_favor, :votes_against, :votes_abstention, :conclusion)
CONCLUSIONS = ['Aprovad', 'Rejeitad']
status = 'FINDING_START'
PARTIES_INDICES = nil
PARTIES_LINE_START = ' PS'
@andrepcg
andrepcg / dns.md
Created June 12, 2019 09:14
Usar Pi-Hole em todos os devices da rede (excepto box IPTV da vodafone)
  1. Activar servidor DHCP no Pi-Hole
  2. Criar ficheiro /etc/dnsmasq.d/03-vodafone.conf
  3. Adicionar a seguinte configuração ao ficheiro
dhcp-host=<MAC ADDRESS DA TV BOX>,set:vodafone
dhcp-option=tag:vodafone,option:dns-server,<IP DO ROUTER DA VODAFONE>

Agora a Box continua a funcionar porque usa o DNS que o router da Vodafone lhe dá e todos os restantes dispositivos na rede utilizam o DNS anunciado pelo servidor DHCP que é o do Pi-Hole

import React, { useState, useContext, useEffect } from "react";
import { Card, Row, Input, Text } from "./components";
import ThemeContext from "./ThemeContext";
function Greeting(props) {
let [name, setName] = useState("Harry");
let [surname, setSurname] = useState("Potter");
let theme = useContext(ThemeContext);
useEffect(() => {
import * as React from "react";
import { Card, Row, Input, Text } from "./components";
import ThemeContext from "./ThemeContext";
class Greeting extends React.Component {
constructor() {
super(...arguments);
this.state = {
name: "Harry",
sureName: "Potter",
import React, { useState } from "react";
const useCounter = (initialValue) => {
const [count, setCount] = useState(initialValue);
const increment = () => setCount(count + 1);
const decrement = () => setCount(count - 1);
return { count, increment, decrement };
};
function Counter() {
const Product = React.memo((props) => {
const { name, price } = props;
return (
<div className="product-info">
<span>{name}</span>
<span>{price}</span>
</div>
);
});