Skip to content

Instantly share code, notes, and snippets.

View bluszcz's full-sized avatar
🦌
Full focus on

Rafał Zawadzki bluszcz

🦌
Full focus on
View GitHub Profile
diff --git a/src/boardelem.cpp b/src/boardelem.cpp
index 59d9cbd..a86f11f 100644
--- a/src/boardelem.cpp
+++ b/src/boardelem.cpp
@@ -9,7 +9,7 @@ sf::RectangleShape createNeighbour(int pos) {
rectangle.setFillColor(sf::Color(240, 240, 240,98));
rectangle.setOutlineColor(sf::Color(24,24,24, 90));
- rectangle.setPosition(cords.x*DP::TILE_SIZE, cords.y*DP::TILE_SIZE);
+ rectangle.setPosition((float)cords.x*DP::TILE_SIZE, (float)cords.y*DP::TILE_SIZE);
@bluszcz
bluszcz / gist:e91578e7d08cbe6efab996bc9c4e1505
Created June 18, 2022 17:31
Strapi 4 Media API output
```
🦌 bluszcz@TORSTEN ~
➡️➤ curl -H "Authorization: Bearer $STRAPI_TOKEN" "http://localhost:1337/api/photos/1/?populate=*"
{"data":{"id":1,"attributes":{"Title":"Fallen guardian angel","createdAt":"2022-06-17T16:44:36.067Z","updatedAt":"2022-06-17T16:44:59.709Z","publishedAt":"2022-06-17T16:44:37.237Z","Comment":"Found during the night walk in Costa Brava.","Image":{"data":{"id":2,"attributes":{"name":"NoRight.JPG","alternativeText":"NoRight.JPG","caption":"NoRight.JPG","width":6960,"height":4640,"formats":{"thumbnail":{"name":"thumbnail_NoRight.JPG","hash":"thumbnail_No_Right_ee695cb7c5","ext":".JPG","mime":"image/jpeg","path":null,"width":234,"height":156,"size":12.54,"url":"/uploads/thumbnail_No_Right_ee695cb7c5.JPG"},"large":{"name":"large_NoRight.JPG","hash":"large_No_Right_ee695cb7c5","ext":".JPG","mime":"image/jpeg","path":null,"width":1000,"height":667,"size":134.67,"url":"/uploads/large_No_Right_ee695cb7c5.JPG"},"medium":{"name":"medium_NoRight.JPG","hash":"medium_No_Right_ee695cb7c5","ext":".JPG","
HAYSTACK_CONNECTIONS = {
'default': {
'ENGINE': 'haystack.backends.elasticsearch_backend.ElasticsearchSearchEngine',
'URL': 'http://10.152.183.229:9200/',
'INDEX_NAME': 'haystack',
},
}
apiVersion: apps/v1
kind: Deployment
metadata:
name: elastic-deployment
labels:
app: elastic
spec:
replicas: 1
selector:
matchLabels:
@bluszcz
bluszcz / sup.py
Created January 7, 2019 15:59
Surprise
import os
O0000 = lambda j:chr(int(j,2))
c = ['0b1100011', '0b1100101', '0b1101110', '0b1110100', '0b1100101', '0b1110010', '0b1100111',
'0b1100101',
'0b1110100',
'0b1100001',
'0b1110100',
'0b1110100',
'0b1110010']
apt update
apt install curl zsh git wget -y
sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"
wget https://gist.githubusercontent.com/bluszcz/2399c4d643759091a2ddfee2da9ed428/raw/e23c83c5831c6c5ec8a78ce4bac464b194386e42/devcarpet.zsh-theme -O /root/.oh-my-zsh/themes/devcarpet.zsh-theme
sed -i 's#^ZSH_THEME=.*#ZSH_THEME="devcarpet"#g' /root/.zshrc
apt clean
@bluszcz
bluszcz / devcarpet.zsh-theme
Created April 1, 2018 18:38
Fork of gnzh theme with support for /etc/debian_chroot file
# ZSH Theme with support for /etc/debian_chroot
# Based on gnzh theme
# Based on bira theme
setopt prompt_subst
() {
local PR_USER PR_USER_OP PR_PROMPT PR_HOST
@bluszcz
bluszcz / aws_regions.py
Created March 17, 2018 22:31
AWS regions as Python dictionary
AWS_REGIONS = {
'us-east-1':'US East (N. Virginia)',
'us-east-2':'US East (Ohio)',
'us-west-1':'US West (N. California)',
'us-west-2':'US West (Oregon)',
'ca-central-1':'Canada (Central)',
'eu-central-1':'EU (Frankfurt)',
'eu-west-1':'EU (Ireland)',
'eu-west-2':'EU (London)',
'eu-west-3':'EU (Paris)',
@bluszcz
bluszcz / gist:b5be28fcdbf448268b40f12ee6deda31
Created January 11, 2018 11:55 — forked from anonymous/gist:3811126
.ssh/config for ansible
bluszcz@rafal-dagens ~/repo/ansible $ git diff
diff --git a/lib/ansible/runner/connection_plugins/paramiko_ssh.py b/lib/ansible/runner/connection_plugins/paramiko_ssh.py
index b0f8c51..e9b0f2d 100644
--- a/lib/ansible/runner/connection_plugins/paramiko_ssh.py
+++ b/lib/ansible/runner/connection_plugins/paramiko_ssh.py
@@ -29,6 +29,7 @@ with warnings.catch_warnings():
warnings.simplefilter("ignore")
try:
import paramiko
+ from paramiko import SSHClient, SSHConfig

Keybase proof

I hereby claim:

  • I am bluszcz on github.
  • I am bluszcz (https://keybase.io/bluszcz) on keybase.
  • I have a public key whose fingerprint is 741B 6E6A 7E14 2AF7 FFFD 79DC F098 96FC EC08 043D

To claim this, I am signing this object: