Skip to content

Instantly share code, notes, and snippets.

View Shayan-To's full-sized avatar

Shayan Toqraee Shayan-To

View GitHub Profile
@Shayan-To
Shayan-To / sanaar-download-excel-injector.js
Last active May 11, 2023 07:41
Sanaar download excel injector
// sanaar\.ir/supervisor/assignment
div = document.createElement('div')
div.innerHTML = '<div class="panel-toolbar"><button class="btn btn-outline-info waves-effect waves-themed btn-sm mr-1" type="button" data-download="excel" onclick="downloadExcel22()"><span><i class="fal fa-file-excel mr-1"></i> دانلود اکسل</span></button></div>'
document.querySelector('.panel-hdr').append(div.firstChild)
async function downloadExcel22() {
const pl = document.querySelectorAll('.page-link')
const pages = +pl[pl.length - 1].dataset.page
const t = await Promise.all(new Array(pages).fill(0).map((_, i) => fetch(`https://sanaar.ir/supervisor/assignment/page/${i + 1}/${location.search}`).then(r => r.text())))
@Shayan-To
Shayan-To / ANSI.md
Created March 4, 2023 14:45 — forked from fnky/ANSI.md
ANSI Escape Codes

ANSI Escape Sequences

Standard escape codes are prefixed with Escape:

  • Ctrl-Key: ^[
  • Octal: \033
  • Unicode: \u001b
  • Hexadecimal: \x1B
  • Decimal: 27
@Shayan-To
Shayan-To / .gitignore
Created August 3, 2022 17:03
Volar organize imports
/node_modules/
@Shayan-To
Shayan-To / .gitignore
Last active July 8, 2022 18:37
Volar organize imports
/node_modules/
@Shayan-To
Shayan-To / .gitignore
Last active June 9, 2022 15:47
Volar repro
/node_modules/
@Shayan-To
Shayan-To / .gitignore
Last active June 9, 2022 15:46
Volar Repro
/node_modules/
function scrollDebug(div: HTMLDivElement) {
let scrollLeft: PropertyDescriptor | undefined;
let t: any = div;
while (!scrollLeft) {
scrollLeft = Object.getOwnPropertyDescriptor(t, "scrollLeft");
t = Object.getPrototypeOf(t);
}
Object.defineProperty(div, "scrollLeft", {
...scrollLeft,
set(v) {
@Shayan-To
Shayan-To / History\-1037d9c5\entries.json
Last active January 11, 2024 14:32
Visual Studio Code Settings Sync Gist
{"version":1,"resource":"file:///d%3A/Shayan/MyDocuments/Coding/Goldika/api/src/app/Http/Resources/ExchangeResource.php","entries":[{"id":"6483.php","timestamp":1676968875808},{"id":"pEXO.php","timestamp":1678542669065},{"id":"6NYf.php","timestamp":1678759436757},{"id":"HSLr.php","timestamp":1678867956241},{"id":"7K4h.php","timestamp":1678868118474}]}
@Shayan-To
Shayan-To / UnicodeBidiClassExtract.ps1
Created April 19, 2017 13:57
A script for extracting bidirectional class of characters from Unicode character database
# This script needs http://www.unicode.org/Public/9.0.0/ucd/UCD.zip extracted next to it.
$Content = Get-Content .\UCD\extracted\DerivedBidiClass.txt
$List = (0..[System.Convert]::ToInt32("110000", 16) | ForEach-Object {"L"})
$Content = $Content | ForEach-Object {$_.Substring(0, ($_.IndexOf("#") | ForEach-Object {If ($_ -NE -1) {$_} Else {0}})).Trim()} `
| Where-Object Length -NE 0
ForEach ($L In $Content)
@Shayan-To
Shayan-To / scriptout.cpp
Last active January 2, 2017 12:18
Simple C++ code to replay the output of script using the timing file
#include <iostream>
#include <fstream>
#include <thread>
#include <chrono>
#include <string>
#include <algorithm>
using namespace std;
int main(int argc, char **argv)