Skip to content

Instantly share code, notes, and snippets.

View eyvoro's full-sized avatar
🏠
Working from home

eyvoro

🏠
Working from home
View GitHub Profile
@eyvoro
eyvoro / sync_uablacklist
Created January 20, 2024 15:04 — forked from uablacklist/sync_uablacklist
Добавляет IP подсети, заблокированные украинским правительством, из https://uablacklist.net в список адресов вашего Mikrotik
:local apiPrefix "https://uablacklist.net/subnets_mikrotik_"
:local tempFile "uablacklist.txt"
:local listName "uablacklist"
/log info "removing existing '$listName'..."
:put "removing existing '$listName'..."
/ip firewall address-list remove [/ip firewall address-list find list=$listName]
# mikrotik can't load >4KB file inside a variable, so backend contains file pieces which we download and parse one by one
:local i 0
@eyvoro
eyvoro / custom_time.go
Created September 26, 2022 08:27 — forked from lummie/custom_time.go
Golang custom date / time formats when marshalling to JSON
// CustomTime provides an example of how to declare a new time Type with a custom formatter.
// Note that time.Time methods are not available, if needed you can add and cast like the String method does
// Otherwise, only use in the json struct at marshal/unmarshal time.
type CustomTime time.Time
const ctLayout = "2006-01-02 15:04:05 Z07:00"
// UnmarshalJSON Parses the json string in the custom format
func (ct *CustomTime) UnmarshalJSON(b []byte) (err error) {
<?php
define('BOT_TOKEN', 'XXXXXXXX:XXXXXXXXXXXXXXXXXXXXXXXX'); // place bot token of your bot here
function checkTelegramAuthorization($auth_data) {
$check_hash = $auth_data['hash'];
unset($auth_data['hash']);
$data_check_arr = [];
foreach ($auth_data as $key => $value) {
$data_check_arr[] = $key . '=' . $value;
@eyvoro
eyvoro / main.go
Created June 5, 2021 14:23 — forked from buroz/main.go
Golang SOAP Request Example
package main
import (
"bytes"
"crypto/tls"
"encoding/xml"
"fmt"
"io/ioutil"
"net/http"
"strings"
@eyvoro
eyvoro / sleep.ino
Created April 7, 2021 10:34 — forked from stojg/sleep.ino
Arduino sleep example
#include "Arduino.h"
#include <avr/sleep.h>
#include <avr/power.h>
#include <avr/wdt.h>
// Blink Before sleeping
#define LED_PIN (13)
// This variable is made volatile because it is changed inside
// an interrupt function
@eyvoro
eyvoro / AVR Sleep
Created April 6, 2021 20:17 — forked from JChristensen/AVR Sleep
AVR microcontroller sleep demonstrations
Simple demonstrations of putting AVR microcontrollers to sleep in power-down mode,
which results in minimum current. Coded with Arduino IDE version 1.0.4 (and with
the Arduino-Tiny core for the ATtiny MCUs, http://code.google.com/p/arduino-tiny/)
For ATmega328P, ~0.1µA.
For ATtinyX5 revisions that implement software BOD disable, ~0.1µA,
for ATtinyX5 revisions that don't, ~20µA.
openocd_rp2040.exe -f interface/jlink.cfg -f target/rp2040.cfg -c "program C:\\Projects\\pico\\.pio\\build\\raspberry-pi-pico\\APPLICATION.elf verify reset exit"
@eyvoro
eyvoro / wp-tools.php
Created January 25, 2018 09:40
wp-tools.php
<?php
if ( !defined('SAVEQUERIES') && isset($_GET['debug']) && $_GET['debug'] == 'sql' )
define('SAVEQUERIES', true);
if ( !function_exists('dump') ) :
/**
* dump()
*
* @param mixed $in
* @return mixed $in
**/
@eyvoro
eyvoro / minify.go
Created January 28, 2017 23:23 — forked from jeevatkm/minify.go
Minify Filter - Revel Framework - Go Lang. Article: http://myjeeva.com/minify-filter-revel-framework-go-lang.html
//
// The MIT License (MIT)
//
// Copyright (c) 2016 Jeevanandam M. ([email protected])
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
The List of Country Codes
Country Code
Afghanistan AF
Aland Islands AX
Albania AL
Algeria DZ
American Samoa AS
Andorra AD
Angola AO