Skip to content

Instantly share code, notes, and snippets.

View destag's full-sized avatar
💻
Coding

Przemysław Pietras destag

💻
Coding
  • Warsaw, Poland
  • 11:41 (UTC +01:00)
View GitHub Profile
@destag
destag / snippets.zsh
Created June 22, 2024 11:03
ZSH aliases
#!/bin/zsh
alias cd..='cd ..'
@destag
destag / client.go
Created May 23, 2023 17:04
Combahton client in fasthttp
package combahton
import (
"encoding/base64"
"encoding/json"
"fmt"
"net/http"
"github.com/spf13/viper"
"github.com/valyala/fasthttp"
#!/bin/bash
sudo apt install curl git inotify-tools
git clone https://github.com/asdf-vm/asdf.git ~/.asdf --branch v0.11.3
curl -L https://fly.io/install.sh | sh
cat >> ~/.bashrc << 'EOF'
export FLYCTL_INSTALL="/home/gitpod/.fly"
@destag
destag / Jenkinsfile
Last active September 1, 2021 12:41
Jenkinsfile to generate jobs
pipeline {
agent any
stages {
stage('print hello') {
steps {
echo 'Hello World'
}
}
root = true
[*]
indent_size = 4
indent_style = space
[alias]
tree = "log --graph --all --pretty=format:'%C(auto)%h -%C(auto)%d (%C(auto)%cr) - %C(dim white)%an%n'' %C(dimcyan)%s'"
#include "arduinoFFT.h"
// deklaracja stałych
#define SAMPLES 128
#define SAMPLING_FREQUENCY 1000 // Hz, musi być mniejsze od 10000 ze względu na ADC
#define CHANNEL A3 // pin arduino z którego odczytujemy wartość sygnału
arduinoFFT FFT = arduinoFFT();
unsigned int sampling_period_us;
def poprawiacz(file_path):
new_file = []
with open(file_path, 'r') as file:
for line in file:
new_line = line.replace('>> ', '')
new_line = new_line.replace('’', "'")
try:
int(new_line)
except ValueError:
new_file.append(new_line)
@destag
destag / collatz.py
Last active November 25, 2017 21:46
def longest_collatz(start, stop):
values = set()
starts = {}
max_seq = 0
max_start = 0
for i in range(start, stop):
if i not in values:
length = 0
for value in CollatzSeq(i):
if value in starts.keys():
@destag
destag / algen.py
Last active November 13, 2017 07:07
algen2
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import numpy as np
from time import time
import matplotlib.pyplot as plt
class Populacja:
def __init__(self, liczba_osobnikow, funkcja, p_mutacji, p_krzyzowanie, zbior_danych=None):