Skip to content

Instantly share code, notes, and snippets.

@aol1306
aol1306 / install-fish-parrot.md
Created June 4, 2023 17:11
Installing fish on ParrotOS

Fish does not install normally with apt install fish on ParrotOS (as of 5.3), because of the following error:

trying to overwrite '/etc/fish/config.fish', which is also in package parrot-core 5.1.9

You can force overwrite of this file with:

cp /etc/fish/config.fish /tmp
@aol1306
aol1306 / README.md
Last active December 13, 2022 23:23
Creating a minimal Rust WASM library

How to create a minimal Rust WASM library

You need wasm-pack to build wasm libs (https://rustwasm.github.io/wasm-pack/installer/).

  1. Generate new project with cargo new wasm-minimal.
  2. cargo add wasm-bindgen
  3. Write a public function that returns a String in src/lib.rs. Annotate with #[wasm_bindgen]. Add use wasm_bindgen::prelude::*;
use wasm_bindgen::prelude::*;
@aol1306
aol1306 / cl.c
Last active May 7, 2021 12:53
OpenCL identify platform
// clang -framework OpenCL -ansi -Wall cl.c
#include <stdio.h>
#include <stdlib.h>
#include <OpenCL/opencl.h>
/* 0 - ok
* 1 - err */
int identify_platform() {
@aol1306
aol1306 / main.rs
Last active July 13, 2020 17:09
STM32F303 timer interrupt + peripheral access
#![no_std]
#![no_main]
use panic_halt as _;
use cortex_m_rt::entry;
use stm32f3xx_hal::prelude::*;
use stm32f3xx_hal::stm32;
package com.company;
import java.util.EnumSet;
// Material -> Fluid, Solid
// polimorficzne get amount
abstract class Material {
String name;
public Material(String name) {
@aol1306
aol1306 / Main.java
Created April 24, 2020 10:06
MAS02 - not ready
package com.company;
import java.util.*;
public class Main {
public static void main(String[] args) throws Exception {
Cemetery c = new Cemetery("Cmentarz główny");
var g1 = new Grave();
var g2 = new Grave();
@aol1306
aol1306 / knn.py
Created April 5, 2020 09:06
MIW2 kNN python
#!/usr/bin/python3
import random
import math
import numpy as np
random.seed(1235)
def import_data():
data = []
@aol1306
aol1306 / papier_kamień.py
Last active March 27, 2020 18:03
MIW1 - jednak działa
#!/usr/bin/python3
import random
import numpy
OPTIONS = ["papier", "kamień", "nożyce"]
ZWYCIESTWA_GRACZA = 0
ZWYCIESTWA_PROGRAMU = 0
@aol1306
aol1306 / main.rs
Created December 6, 2019 09:13
Actix web minimal example, using macros for defining routes
use actix_web::{get, App, HttpServer, Responder, HttpResponse};
#[get("/hello")]
fn index() -> impl Responder {
HttpResponse::Ok().body("Hey there!")
}
fn main() {
HttpServer::new(|| {
App::new()
@aol1306
aol1306 / Program.cs
Created June 9, 2019 05:35
Using Rust DLL libraries with C#
using System;
using System.Runtime.InteropServices;
namespace RsLibTest
{
class Program
{
[DllImport(@"C:\rslib.dll")]
static extern int add(int a, int b);