Skip to content

Instantly share code, notes, and snippets.

View alksily's full-sized avatar
🏠
Working from home

Aleksey Ilyin alksily

🏠
Working from home
View GitHub Profile
@alksily
alksily / task.md
Created September 11, 2023 21:45
Test task PHP

Develop a simple web page for uploading and displaying images. Your task includes the following steps:

  1. Create an HTML form for uploading images to the server.
  2. Write a PHP script to handle the uploaded image and save it on the server.
  3. Display the uploaded image on the page after a successful upload.

Requirements:

  1. Use PHP to handle image upload and display.
  2. Ensure security checks for uploaded files.
  3. Make the page visually appealing using HTML and CSS.
@alksily
alksily / README.md
Created November 10, 2019 11:50
How install push stream module for nginx on debian, ubuntu

Install NGINX with nginx-push-stream-module

Gist for Ubuntu and Debian users

Easy

nginx 1.16.1 + push stream module latest

apt-get update -y \
JavaScript Test Task
The web application should meet the following requirements:
1. A search bar for cities
2. Search results with weather information
3. A list of saved cities
4. Current position weather
Points to consider:
- Application structure
@alksily
alksily / Snowflake.php
Created March 1, 2019 12:27
Snowflake
<?php
define('EPOCH', 1414213562373);
define('NUMWORKERBITS', 10);
define('NUMSEQUENCEBITS', 12);
define('MAXWORKERID', (-1 ^ (-1 << NUMWORKERBITS)));
define('MAXSEQUENCE', (-1 ^ (-1 << NUMSEQUENCEBITS)));
class Snowflake
@alksily
alksily / main.java
Created March 1, 2019 12:27
Launch frame
float f = (float) (Runtime.getRuntime().maxMemory() / 1024L / 1024L);
if(f > MIN_HEAP){
LauncherFrame.main(args);
}else{
try{
ArrayList<String> localArrayList = new ArrayList<String>();
String str = TGMMain.class.getProtectionDomain().getCodeSource().getLocation().toURI().getPath();
@alksily
alksily / OperationSystem.java
Created March 1, 2019 12:26
Detect operation system
package ru.aengine.util;
public class OperationSystem {
public static OS getPlatform() {
String str = System.getProperty("os.name").toLowerCase();
if(str.contains("win")) return OS.WINDOWS;
if(str.contains("mac")) return OS.MACOS;
if(str.contains("solaris")) return OS.SOLARIS;
if(str.contains("sunos")) return OS.SOLARIS;
@alksily
alksily / NoiseGenerator.java
Last active April 28, 2024 09:31
Perlin Noise (1D, 2D, 3D noise generator)
package main.ru.aengine.noise;
import java.util.Random;
public class NoiseGenerator {
private double seed;
private long default_size;
private int[] p;
private int[] permutation;
@alksily
alksily / Logger.java
Created March 1, 2019 12:25
Logger.java
package ru.aengine.tgm.util;
import java.io.BufferedWriter;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.OutputStreamWriter;
import java.io.UnsupportedEncodingException;
/**
@alksily
alksily / StreamReader.java
Created March 1, 2019 12:25
Named Data Tags
package ru.aengine.ndt;
import java.io.*;
import java.util.*;
import java.util.zip.*;
/**
* Named Data Tags (NDT) - file format for save array map.
* StreamReader class for read data from *.ndt file;
*/
@alksily
alksily / bundle.js
Created March 1, 2019 12:24
App bundle.js
/**
* Copyright (c) 2017, AEngine Official
* MIT License
*
* Need: jQuery, Backbone & Lodash
*/
'use strict';
// App
let App = {};