Skip to content

Instantly share code, notes, and snippets.

View racinmat's full-sized avatar
🎨
Playing with Stable Diffusion in spare time.

Matěj Račinský racinmat

🎨
Playing with Stable Diffusion in spare time.
View GitHub Profile
void setTree(int[] values) {
setTree(values, 0, values.length);
}
void setTree(int[] values, int begin, int end) { //pole je např. (2,4,6,8,10,12) a já chci jen (10,12), tak pžedám pole, a begin = 4(index počátečního prvku) a end = 6 (velikost pole+index počátečního prvku)
int length = end-begin;
if(length % 2 == 0) {//je sudé
this.value = values[begin+length/2];
Node left = new Node();
this.left = left;
<?php
$originalWidth = 700;
$originalHeight = 70;
$originalImage = imagecreatetruecolor($originalWidth, $originalHeight);
$white = imagecolorallocate($originalImage, 255, 255, 255);
$black = imagecolorallocate($originalImage, 0, 0, 0);
imagefill($originalImage, 0, 0, $white);
imagettftext($originalImage, 40, 0, 5, 50, $black, 'arial.ttf', 'Testing string, lorem ipsum');
imagepng($originalImage, 'original-text.png');
@racinmat
racinmat / redirect.php
Created March 29, 2016 13:04
Redirect to random url address from array
<?php
/**
* Created by PhpStorm.
* User: Azathoth
* Date: 29. 3. 2016
* Time: 14:54
*/
$addresses = [
'http://www.google.com',
@racinmat
racinmat / example.html
Created September 9, 2016 12:37
appending html with javascript
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
</head>
<body>
<h2>seznam</h2>
<ul>
<li>položka</li>
@racinmat
racinmat / odkazy
Last active June 15, 2017 21:43
základy programování
tutoriály na základy programování:
https://codecombat.com/
https://www.udemy.com/code-dynamic-websites/
https://www.youtube.com/watch?v=XL9Ri8pO68w
https://www.youtube.com/watch?v=6WjTWZSPHrk
https://www.udemy.com/php-mysql-tutorial/
https://alison.com/courses/Introduction-to-PHP-and-MySQL-Programming
https://www.coursera.org/learn/learn-to-program
https://www.coursera.org/learn/intro-programming
@racinmat
racinmat / KGLh-0.py
Created August 11, 2017 11:44
null created by racinmat - https://repl.it/KGLh/0
import time
now = time.localtime()
hour = now.tm_hour
if hour < 8: print('sleeping')
elif hour < 9: print('commuting')
elif hour < 17: print('working')
elif hour < 18: print('commuting')
elif hour < 20: print('eating')
elif hour < 22: print('resting')
else: print('sleeping')
'''
print("tohle se vypsalo")
celeCislo = 5
print(celeCislo)
print(type(celeCislo))
celeCislo = 5.5
print(celeCislo)
print(type(celeCislo))
@racinmat
racinmat / factorio-science-packs.dot
Last active August 31, 2017 18:17
factorio crafting schema
digraph G {
"iron_gear_wheel" -> "iron_plate"
"science_pack_1" -> "copper_plate"
"science_pack_1" -> "iron_gear_wheel"
subgraph cluster0 {
"science_pack_2" -> "inserter"
"science_pack_2" -> "transport_belt"
}