Skip to content

Instantly share code, notes, and snippets.

View Phitherek's full-sized avatar
💭
-> GitLab

Phitherek_ Phitherek

💭
-> GitLab
View GitHub Profile
@Phitherek
Phitherek / docker-cleanup.sh
Created March 21, 2018 12:59
An updated version of the Docker cleanup script, originally from https://lebkowski.name/docker-volumes/
#!/bin/bash
# remove exited containers:
docker ps --filter status=dead --filter status=exited -aq | xargs -r docker rm -v
# remove unused images:
docker images --no-trunc | grep '<none>' | awk '{ print $3 }' | xargs -r docker rmi
# remove unused volumes:
docker volume ls -qf dangling=true | xargs -r docker volume rm
@Phitherek
Phitherek / PKGBUILD
Created January 28, 2017 22:28
Working PKGBUILD for lib32-glxosd-git package based on my own upstream fixes
# Maintainer: Maxime Poulin <maxpoulin64@gmail.com>
# Contributor: xpander <xpander0@gmail.com>
pkgname=lib32-glxosd-git
_gitname=GLXOSD
pkgver=r203.f5a515d
pkgrel=1
pkgdesc="An OSD for OpenGL applications running under the X Window System. This allows you to monitor your framerate and hardware temperature in games on Linux!"
arch=('i686' 'x86_64')
url="https://github.com/Phitherek/GLXOSD"
license=('GPL')
@Phitherek
Phitherek / bigarray.cpp
Created March 20, 2015 19:25
Big array in C++
#include <iostream>
#include <cstdlib>
using namespace std;
int main() {
int* tab;
tab = new int[10000000];
for(int i = 0; i < 10000000; i++) {
tab[i] = 0;
}
@Phitherek
Phitherek / NOTICE
Created October 4, 2012 19:53
algoprep p. 2
Use algoprep.cpp, algoprep.h and Makefile from here: https://gist.github.com/3721876
@Phitherek
Phitherek / 3m.cpp
Created September 18, 2012 19:10
3m temporary code paste
#include <iostream>
#include <cstdlib>
#include <sys/socket.h> // For sockets
#include <sys/types.h> // For getaddrinfo
#include <arpa/inet.h> // For inet addr conversion
#include <netdb.h> // For getaddrinfo
#include <cstring> // For memset
#include <cerrno>
#include <unistd.h>
#include <string>
@Phitherek
Phitherek / actselector.cpp
Created September 14, 2012 13:24
algoprep
#include <iostream>
#include <cstdlib>
#include <algorithm>
#include "algoprep.h"
using namespace std;
struct activity {
int s;
int f;
};
@Phitherek
Phitherek / minesweeper.cpp
Created July 23, 2012 23:12
Minesweeper v. 0.1
// Minesweeper v. 0.1 (c) 2012 by Phitherek_
#include <iostream> // Do streamów IO
#include <cstdlib> // EXIT_SUCCESS i inne przydatne rzeczy z C
#include <iomanip> // Do manipulacji streamem IO - ustawienie szerokości wierszy, aby zwiększyć czytelność planszy
using namespace std; // Odkrycie standardowej przestrzeni nazw - bo nic nam nie będzie kolidować z tą przestrzenią
struct field { // Struktura opisująca pole na planszy:
int bomb; // Czy jest bomba na tym polu? 1 - tak, 0 - nie
int checked; // Czy pole jest odkryte? 1 - tak, 0 - nie
int ba; // Ilość bomb wokół pola
@Phitherek
Phitherek / robot.c
Created June 21, 2012 22:05
Implementacja algorytmu z robotem w C
#include <stdio.h>
#include <stdlib.h>
// Mamy robota, który ma przejść daną odległość, możliwe są ruchy o 1, 2 lub 3. Chcemy się dowiedzieć, ile jest kombinacji, w jakich nasz robot może przejść tą odległość.
struct wyniki { // Struktura przechowuje liczbę możliwości dla następnego kroku o
int o; // 1
int t; // 2
int th; // 3
};
@Phitherek
Phitherek / radiozet
Created April 22, 2012 21:42
A script that plays a Polish radio station RadioZet with MPlayer and offers server choice
#!/bin/bash
if [[ $# -ne 1 ]]
then
echo "Usage: $0 [server_number 03-40]"
else
if [ $1 != "03" ] && [ $1 != "04" ] && [ $1 != "05" ] && [ $1 != "06" ] && [ $1 != "07" ] && [ $1 != "08" ] && [ $1 != "09" ] && [[ $1 -lt 10 ]] || [[ $1 -gt 40 ]]
then
echo "Usage: $0 [server_number 03-40]"
else
mplayer http://radiozetmp3-$1.eurozet.pl:8400/
@Phitherek
Phitherek / COMPILATION
Created March 26, 2012 16:47
Phitherek_' s Decider v. 0.1 GTK
Kompiluj przy użyciu/compile using:
g++ -o decider_gtk decider_gtk.cpp `pkg-config --cflags --libs gtk+-2.0`