Skip to content

Instantly share code, notes, and snippets.

View equalent's full-sized avatar
🇵🇸

Andrei Tsurkan equalent

🇵🇸
View GitHub Profile
<!DOCTYPE>
<html>
<head>
<title>Hello world</title>
</head>
<body>
<p>HELLO WORLD</p>
</body>
</html>
@equalent
equalent / readme.md
Created January 13, 2018 08:55 — forked from RaVbaker/readme.md
[HOWTO] Rewrite all urls to one index.php in Apache

Redirect All Requests To Index.php Using .htaccess

In one of my pet projects, I redirect all requests to index.php, which then decides what to do with it:

Simple Example

This snippet in your .htaccess will ensure that all requests for files and folders that does not exists will be redirected to index.php:

RewriteEngine on

RewriteCond %{REQUEST_FILENAME} !-d

@equalent
equalent / sketch_180604a.pde
Created June 4, 2018 07:56
Processing Fullscreen Russian Flag
int valup=0;
int valright=0;
int speed=3;
String l(String hx){
String sh = hx;
int n = unhex(sh);
char[] chars = Character.toChars(n);
return new String(chars);
}
@equalent
equalent / NpcSpawner.cs
Last active April 22, 2020 21:42
NPC Spawner Component for Unity
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
public class NpcSpawner : MonoBehaviour {
[Header("NPC Spawner Configuration")]
[Tooltip("A refab list of NPCs that can be spawned. Spawner will destroy itself is this list is empty.")]
public GameObject[] Spawnables;
[Tooltip("A spawn interval in seconds. (5 sec by default)")]
public float interval = 5f;
@equalent
equalent / CameraController.cs
Created August 15, 2018 19:43
Unity Engine 3-rd Person Camera Controller
using UnityEngine;
using System.Collections.Generic;
public class CameraController : MonoBehaviour {
[Header("Camera Properties")]
public float DistanceAway; //how far the camera is from the player.
public float DistanceUp; //how high the camera is above the player
public float smooth = 4.0f; //how smooth the camera moves into place
public float rotateAround = 70f; //the angle at which you will rotate the camera (on an axis)
[Header("Player to follow")]
@equalent
equalent / string_split.cpp
Created October 7, 2018 14:52 — forked from float-tw/string_split.cpp
c++ string split
#include <iostream>
#include <vector>
#include <string>
using namespace std;
void split(string source, string delim, vector<string>& result)
{
string tmp;
size_t now=-1, next=-1;
@equalent
equalent / ac.cc
Last active May 6, 2020 20:20
Detect running Cheat Engine (simple anti-cheat)
#include <Windows.h>
#include <Psapi.h>
#include <TlHelp32.h>
#include <string.h>
BOOL IsCheatEngineRunning()
{
PROCESSENTRY32 pe32 = { sizeof(PROCESSENTRY32) };
HANDLE hSnapshot = CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0);
@equalent
equalent / LogonTime.cs
Last active July 21, 2019 08:16 — forked from anlai/LogonTime.cs
Classes for working with Active Directory logon time
public class LogonTime
{
public DayOfWeek DayOfWeek { get; set; }
public DateTime BeginTime { get; set; }
public DateTime EndTime { get; set; }
public LogonTime(DayOfWeek dayOfWeek, DateTime beginTime, DateTime endTime)
{
DayOfWeek = dayOfWeek;
BeginTime = beginTime;
@equalent
equalent / ca.md
Created June 20, 2019 07:12 — forked from soarez/ca.md
How to setup your own CA with OpenSSL

How to setup your own CA with OpenSSL

For educational reasons I've decided to create my own CA. Here is what I learned.

First things first

Lets get some context first.

@equalent
equalent / dxrcheck.h
Last active July 21, 2019 05:19
Check DirectX Raytracing support [WITH COMMENTS]
inline bool IsDirectXRaytracingSupported(IDXGIAdapter1* adapter)
{
ComPtr<ID3D12Device> testDevice;
D3D12_FEATURE_DATA_D3D12_OPTIONS5 featureSupportData = {};
// create Direct3D 12 device with 11.0 FL
// IID_PPV_ARGS automatically computes interface ID (REFIID that equals to IID_ID3D12Device)
// and the pointer and passes them as two comma-separated arguments
return SUCCEEDED(D3D12CreateDevice(adapter, D3D_FEATURE_LEVEL_11_0, IID_PPV_ARGS(&testDevice)))
// check support for OPTIONS5 (will work only on Windows 10 1803+)