Skip to content

Instantly share code, notes, and snippets.

View All emoji.txt
AyrA / WindowedStream.cs
Created March 10, 2023 18:12
Stream that is a window of a bigger stream. Allows to only give parts of a stream to a component
View WindowedStream.cs
using System;
using System.IO;
namespace AyrA.IO
public class WindowedStream : Stream
public override bool CanRead => baseStream.CanRead;
public override bool CanSeek => baseStream.CanSeek;
AyrA / TTT.cs
Last active October 16, 2021 04:04
View TTT.cs
#define TTT_USELINQ //If you feel that Linq is cheating, you can remove this line.
using System;
using System.Linq;
namespace UglyRestrictions
/// <summary>
AyrA / trycopy.php
Created June 16, 2021 09:45
Copy of 4GB+ files failes with PHP on Windows even if FS is NTFS and PHP is 64 bit.
View trycopy.php
//Both files must be on an NTFS volume. You may use the same volume.
//Create large file with mostly zeros but random content at the end
function create_file($src){
echo 'Creating sparse via fsutil...';
AyrA / GetWindowInfoEnum.cs
Created January 24, 2019 21:46
Flags for GetWindowInfo
View GetWindowInfoEnum.cs
//These are for the dwStyle and dwExStyle of WINDOWINFO
public enum WindowStyle : uint
/// <summary>
/// The window is an overlapped window.
/// An overlapped window has a title bar and a border.
/// Same as the WS_OVERLAPPED style.
/// </summary>
WS_TILED = 0x0,
AyrA / konami.js
Created July 8, 2018 02:57
JS Konami code script
View konami.js
//Small konami code script that doesn't uses the usual method of an integer array
//Either run this through a minifier or remove the comments,
//otherwise people can just search for "konami" or variable name combinations
//The string of the konami code itself is almost impossible to find by using search engines.
//cb - required(function), called on complete sequence with all 3 parameters
//check - optional(function), checks if key presses should be evaluated, called with all 3 parameters.
//single - optional(bool), if set to something that evaluates to 'true' the secret can only be used once.
(function (cb, check, single) {
var d = "&&((%'%'BA";
AyrA / http.ps1
Last active August 23, 2023 09:08
Powershell HTTP Server
View http.ps1
# Portable HTTP file server
# Should be somewhat safe but please don't actually use it.
# You can't exit this with CTRL+C directly and need to use the shutdown command below a directory listing,
# or you can kill the powershell process of course, but this causes the port to stay used sometimes.
# Features
# - Directory Browser
# - Can handle UTF8 URLs
# - Delivers unknown file types
# - /../ attack prevention
AyrA / bfjsf.js
Last active October 24, 2020 15:07
Brainfuck interpreter in JSFuck
View bfjsf.js
//Brainfuck Interpreter in JSFuck by /u/AyrA_ch
//Put your code in the line below
Text input is done using 'prompt' function
Text output is shown at the end of the script, because console.log adds linebreaks
The interpreter has 1000000 bytes of memory
AyrA / KDF.cs
Created February 20, 2018 07:45
C# Custom Key derivation
View KDF.cs
using System;
using System.Linq;
using System.Security.Cryptography;
I am in no way claiming that this is secure.
It merely serves as an example on how a key derivation function could work.
AyrA / search.js
Created February 18, 2018 16:35
Find and count multiple words on a website
View search.js
(function (x) {
var text = document.body.textContent;
return (v) {
var m = text.match(new RegExp("\\s(" + v + ")[\\s.,!?]", "gi"));
return m ? m.length : 0;
})(["add", "all", "your", "words", "here"]);