Skip to content

Instantly share code, notes, and snippets.

View fpawel's full-sized avatar

Pavel Filimonenkov fpawel

View GitHub Profile
package main
import (
"bytes"
"crypto/md5"
"fmt"
"testing"
)
// There is a database with hashed user passwords (hashPassword function).
@fpawel
fpawel / c.c
Created December 21, 2021 17:28
while (1)
{
// это надо добавить в начало цикла
if (0 << PA7){
_delay_ms(400) // ?
continue // следующая итерация цикла while (1)
}
// всё что у тебя было ранее
//
@fpawel
fpawel / pprof.md
Created March 18, 2021 10:51 — forked from sudo-suhas/pprof.md
pprof

pprof

With a single import _ "net/http/pprof" you can add profiling endpoints to a HTTP server.

package main

import (
	"fmt"
@fpawel
fpawel / amqp.go
Last active July 11, 2020 08:48
amqp pkcs12
// copy this file to any place
// set environment variables:
// AMQP_URL
// AMQP_CERT_FILE
// AMQP_CERT_PASS
// type:
// go mod init
// go run .
// it should print "ok" if ok, otherwise an error message
package main
import (
"fmt"
)
func main() {
//V := []string{"s", "w", "v", "t"}
//E := []edge{
// {"s", "v", 1},
package main
import (
"fmt"
)
func main() {
V := []int{1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11}
E := [][2]int{
{1, 5},
#define F_CPU 4000000UL
#include <avr/io.h>
#include <util/delay.h>
int main()
{
DDRC = 0b0001111;
DDRB = 0b11111111;
DDRD = 0b11111111;
/* программа для компа, которая выводит
00000001
00000011
00000111
00001111
00011111
00111111
01111111
11111111
00000000
package main
import (
"fmt"
"time"
"syscall"
)
func main() {
ticker := time.NewTicker(time.Second)
CREATE TABLE IF NOT EXISTS record
(
record_id INTEGER NOT NULL PRIMARY KEY,
created_at TIMESTAMP NOT NULL UNIQUE -- UNIQUE - чтобы создать индекс по полю created_at
DEFAULT (STRFTIME('%Y-%m-%d %H:%M:%f', 'NOW')),
process TEXT NOT NULL, --имя процесса, из которого произведено логгирование
msg TEXT NOT NULL, --содержательное сообщение
level TEXT NOT NULL,
work TEXT NOT NULL
);