Skip to content

Instantly share code, notes, and snippets.

View bartekpacia's full-sized avatar
🇺🇦

Bartek Pacia bartekpacia

🇺🇦
View GitHub Profile
{
"data":{
"detections":[
[
{
"confidence":0.7859922051429749,
"isReliable":false,
"language":"en"
}
]
@bartekpacia
bartekpacia / btrams help 2
Created February 18, 2020 18:04
from Rudy with love
#include <math.h>
#include <iostream>
using namespace std;
int main() {
int w, k, a, b, gwiazdki, reszta;
double bkwadrat;
cout << "Wpisz liczbe wierszy ";
cin >> w;
@bartekpacia
bartekpacia / LiveData.kt
Created February 25, 2020 21:49
Kotlinish LiveData.observeOnce
fun <T> LiveData<T>.observeOnce(owner: LifecycleOwner, reactToChange: (T) -> Unit): Observer<T> {
val wrappedObserver = object : Observer<T> {
override fun onChanged(data: T) {
reactToChange(data)
removeObserver(this)
}
}
observe(owner, wrappedObserver)
return wrappedObserver
@bartekpacia
bartekpacia / rip.asm
Created March 3, 2020 20:10
asemblerek
Disassembly of section __TEXT,__text:
__text:
100000df0: 55 pushq %rbp
100000df1: 48 89 e5 movq %rsp, %rbp
100000df4: 48 81 ec c0 00 00 00 subq $192, %rsp
100000dfb: 31 c0 xorl %eax, %eax
100000dfd: 89 c7 movl %eax, %edi
100000dff: 48 8b 0d 1a 12 00 00 movq 4634(%rip), %rcx
100000e06: 48 8b 09 movq (%rcx), %rcx
100000e09: 48 89 4d f8 movq %rcx, -8(%rbp)
@bartekpacia
bartekpacia / messenger_script.js
Last active March 9, 2020 15:45
Paste in the console when on messenger.com and easily scroll up to old messages.
setInterval(function () {
document.getElementById('see_older').getElementsByClassName('content')[0].click();
console.log("Clicking at button...");
}, 500);
console.log("Started");
➜ functions git:(master) ✗ npm ls
functions@ /Users/bartekpacia/dev/node/discover-rudy-functions/functions
├─┬ @types/[email protected]
│ ├─┬ @types/[email protected]
│ │ └── @types/[email protected] deduped
│ └── @types/[email protected] deduped
├─┬ @types/[email protected]
│ ├── @types/[email protected] deduped
│ ├─┬ @types/[email protected]
│ │ ├── @types/[email protected] deduped
@bartekpacia
bartekpacia / breach.py
Last active July 19, 2020 18:40
Some code for the californian kid Dylan. Place the log file next to this Python script file.
rfishield = 0
dfishield = 0
sqlishield = 0
counter = 0
with open("breach.log") as f:
while True:
line = f.readline()
if "blocking reason" in line.lower():
@bartekpacia
bartekpacia / git.plugin.zsh
Last active April 20, 2020 23:04
my ZSH git plugin config
#
# Functions
#
# The name of the current branch
# Back-compatibility wrapper for when this function was defined here in
# the plugin, before being pulled in to core lib/git.zsh as git_current_branch()
# to fix the core -> git plugin dependency.
function current_branch() {
git_current_branch
@bartekpacia
bartekpacia / european_capitals.html
Created May 8, 2020 20:24
Small, shitty website for my non-tech-savyy sister. Polish education system sucks so hard lol.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Europejskie stolice</title>
<h1>Europejskie stolice</h1>
<b>
Na tej stronie będziecie mogli odbyć wirtualną podróż po stolicach Europy.
@bartekpacia
bartekpacia / bartekpacia.zsh
Last active June 9, 2020 14:32
shell scripting is full of surprises that you'd never expect to exist
# ------ Spotify ------
# Play song passed as argument
s() {
# saved_volume=$(spotify vol)
saved_volume="Current Spotify volume level is 50."
if [[ "$saved_volume" =~ [0-9][0-9]?[0-9]? ]]; then
saved_volume=$MATCH
fi