Skip to content

Instantly share code, notes, and snippets.

View karolba's full-sized avatar
:shipit:

Karol Baraniecki karolba

:shipit:
View GitHub Profile
#!/bin/sh
set -ex
apt-get update
apt-get install -y lib32z1 openjdk-7-jre
wget 'https://raw.githubusercontent.com/iBotPeaches/Apktool/master/scripts/linux/apktool' -O /usr/local/bin/apktool
wget 'https://bitbucket.org/iBotPeaches/apktool/downloads/apktool_2.0.2.jar' -O /usr/local/bin/apktool.jar
chmod +x /usr/local/bin/apktool.jar
s, [ t1, t2, t3, t4, t5, t6 ], t śr, t min, t max, Δt, tśr^2, Δt^2
15, [ 1.2, 1.1, 1, 1.1, 1.1, 1 ], 1.08, 1.00, 1.20, 0.20, 1.17, 0.43
30, [ 1.7, 1.7, 1.7, 1.8, 1.7, 1.4 ], 1.67, 1.40, 1.80, 0.40, 2.78, 1.33
45, [ 2, 2.1, 2.2, 1.9, 1.9, 2 ], 2.02, 1.90, 2.20, 0.30, 4.07, 1.21
60, [ 2.3, 2.5, 2.3, 2.4, 2.1, 2.4 ], 2.33, 2.10, 2.50, 0.40, 5.44, 1.87
75, [ 2.6, 2.6, 2.4, 2.7, 2.6, 2.7 ], 2.60, 2.40, 2.70, 0.30, 6.76, 1.56
90, [ 2.9, 2.8, 2.7, 2.8, 2.6, 2.9 ], 2.78, 2.60, 2.90, 0.30, 7.75, 1.67
@karolba
karolba / dist.py
Last active March 20, 2021 04:50
Python shapely: distance from point to LineString
import math
import shapely.geometry as geometry
from typing import Optional
def move_point(point: geometry.Point, angle: float, distance: float) -> geometry.Point:
return geometry.Point(
point.x + math.cos(angle) * distance,
point.y + math.sin(angle) * distance)
@karolba
karolba / worst.cpp
Created June 24, 2018 07:28
Worst c++ cat utility
#include <iostream>
#include <climits>
#include <string>
#include <limits>
#include <cstdio>
#include <functional>
#define b
auto m = <::> (auto bitand a) { while( a, compl decltype (a.a + a.a) (a) ) ( decltype (__FILE__[0]) ) a; };
static inline struct a {
#include <stdlib.h>
#include "Array.h"
struct Array {
size_t len;
T *data;
};
/// Costruction and destruction functions:
#!/usr/bin/env python3
import icalendar
import json
import requests
from dateutil import parser
from datetime import timedelta, datetime
GRUPA_WYKŁAD = 0.0
GRUPA_ĆW = 5.0 # 1.0 dla grupy 1, 2.0 dla grupy 2, itd
#include <iostream>
#include <memory>
#include <json/value.h>
#include <json/reader.h>
#include <json/writer.h>
#include <unistd.h>
#include <string.h>
#include <errno.h>
#include <stdio.h>
#include <ext/stdio_filebuf.h>
@karolba
karolba / quicksort_mips.asm
Created May 9, 2019 16:29
A simple quicksort with a dynamically allocated array implemented for the MARS MIPS emulator
.eqv SYS_PRINT_INT 1
.eqv SYS_READ_INT 5
.eqv SYS_MALLOC 9
.eqv SYS_EXIT 10
.eqv SYS_PRINT_CHAR 11
.eqv SYS_READ_CHAR 12
# macros that push register(s) to the stack
.macro push (%a)
@karolba
karolba / web.nasm
Last active July 25, 2023 19:24
A forking web-server with directory contents listing in x86_64 assembly
extern printf
extern perror
extern exit
extern puts
extern socket
extern bind
extern listen
extern accept
extern close
extern fdopen
@karolba
karolba / set-user-key-mapping.sh
Last active March 14, 2023 05:14
My personal key remappings for macos - for "ISO International Layout" keyboards
#!/bin/bash
common_mapping=(
$' {"HIDKeyboardModifierMappingSrc":0x7000000e7, \n' # <!-- from: right command -->
$' "HIDKeyboardModifierMappingDst":0x7000000e6}, \n' # <!-- to: right option -->
$' \n' #
$' {"HIDKeyboardModifierMappingSrc":0x7000000e6, \n' # <!-- from: right option -->
$' "HIDKeyboardModifierMappingDst":0x7000000e7}, \n' # <!-- to: right command -->
$' \n' #
$' {"HIDKeyboardModifierMappingSrc": 0x7000000E0, \n' # <!-- from: left control -->