Skip to content

Instantly share code, notes, and snippets.

View rosek86's full-sized avatar
👋

Krzysztof Rosiński rosek86

👋
View GitHub Profile
@rosek86
rosek86 / gopro-octoprint.md
Last active January 26, 2023 05:07
Use GoPro with Octoprint
@rosek86
rosek86 / handling_multiple_github_accounts.md
Created November 6, 2022 05:58 — forked from Jonalogy/handling_multiple_github_accounts.md
Handling Multiple Github Accounts on MacOS

Handling Multiple Github Accounts on MacOS

The only way I've succeeded so far is to employ SSH.

Assuming you are new to this like me, first I'd like to share with you that your Mac has a SSH config file in a .ssh directory. The config file is where you draw relations of your SSH keys to each GitHub (or Bitbucket) account, and all your SSH keys generated are saved into .ssh directory by default. You can navigate to it by running cd ~/.ssh within your terminal, open the config file with any editor, and it should look something like this:

Host *
 AddKeysToAgent yes

> UseKeyChain yes

@rosek86
rosek86 / genBitsReversal.py
Last active May 16, 2022 11:24
Bits reversal for CMSIS-DSP FFT
import math
import argparse
from sympy.combinatorics import Permutation
def bits_for_value(value):
return int(math.log2(value))
def decompose(N, R):
logN2 = bits_for_value(N)
logR2 = []
@rosek86
rosek86 / bits_reverse_u32.c
Created November 11, 2019 08:08
uint32_t bits revelsal in c
#include <stdio.h>
#include <stdint.h>
uint32_t bits_reverse_u32(uint32_t val) {
uint32_t out = 0;
for (int i = 0; i < 16; i++) {
out |= ((val & (1 << ( i))) << (31 - (i << 1)));
out |= ((val & (1 << (31 - i))) >> (31 - (i << 1)));
}
return out;
@rosek86
rosek86 / tfjs-signal.ts
Created May 20, 2019 20:38
IIR filter design using tensorflow JS - concept
import * as tf from '@tensorflow/tfjs-node';
import { promises as fs } from 'fs';
function buttap(N: number): { z: tf.Tensor<tf.Rank>, p: tf.Tensor<tf.Rank>, k: tf.Tensor<tf.Rank> } {
/*
Return (z,p,k) for analog prototype of Nth-order Butterworth filter.
The filter will have an angular (e.g. rad/s) cutoff frequency of 1.
See Also
--------
butter : Filter design function using this prototype
@rosek86
rosek86 / is_integer.c
Created May 18, 2019 05:03
Check if double is integer in C
#include <stdio.h>
#include <math.h>
#include <stdlib.h>
#include <stdbool.h>
#include <assert.h>
bool is_integer(double x) {
const double epsilon = 0.0001; // adjust
double fract = fabs(x - round(x));
return fract < epsilon;
// concat
(() => {
const x = [ 1, 2, 3 ];
const y = [ 4, 5, 6 ];
const o = x.concat(y);
console.log(`concat: ${o}`);
})();
// every
(() => {
@rosek86
rosek86 / # gcc - 2018-06-04_20-42-25.txt
Created June 4, 2018 19:49
gcc on macOS 10.13.4 - Homebrew build logs
Homebrew build logs for gcc on macOS 10.13.4
Build date: 2018-06-04 20:42:25