Skip to content

Instantly share code, notes, and snippets.

View ramazansancar's full-sized avatar
📚
Study

Ramazan Sancar ramazansancar

📚
Study
View GitHub Profile
@ramazansancar
ramazansancar / mobile_detect.html
Created August 27, 2024 20:05
Mobile device detection redirector
<!-- view-source:https://www.moneypay.com.tr/download.html -->
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','https://www.google-analytics.com/analytics.js','ga');
@ramazansancar
ramazansancar / svgExternalSourcesBase64Converter.js
Created August 3, 2024 20:47
It converts the SVG file into base64 encoded form to include images fed from external sources and link files such as css and fonts. (I created this so that when a download request is sent with "Export the board" in miro.com and "Save as PDF", the svg file in the "Request Payload" section transmitted from the Developer Console > Network is given …
const axios = require('axios');
const fs = require('fs');
// SVG file to convert
const filePath = './svg_external.svg';
// Output file path
const outputFilePath = './svg_external_export_base64.svg';
/**
@ramazansancar
ramazansancar / decode.js
Last active July 7, 2024 14:13
http://oxax.tv/ JS Cripted Algoritm Decode (JS Wise) (Encryted here: http://oxax.tv/p_n_old.js) UnPacker: https://matthewfl.com/unPacker.html
var o = {
y = "xx???x=xx?xx?="
}
var abc = String.fromCharCode(65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 97, 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120, 121, 122);
var dechar = function (x) {
return String.fromCharCode(x)
};
@ramazansancar
ramazansancar / README.MD
Created February 25, 2024 19:29
rapidvid.net M3u8 Video Download for FFMPEG
/* CONSOLE MESSAGE */
var consoleCopyrightStyle = [
"margin: 16px 0",
"border-radius: 10px"
].join(";");
var consoleWarningHeaderStyle = [
"color: #ff0000",
"font-size: 32px",
"font-weight: 600",
"margin: 8px 0"
@ramazansancar
ramazansancar / ipValidation.js
Created March 16, 2023 18:53
CodeWars Solutions
// Source: https://www.codewars.com/kata/515decfd9dcfc23bb6000006/solutions/javascript
const isValidIP = (str) => {
const octet = '(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]?|0)';
const regex = new RegExp(`^${octet}\\.${octet}\\.${octet}\\.${octet}$`);
return (regex.test(str)) ? true : false
} // Source: https://stackoverflow.com/a/54742549/15030183
function isValidIP(str) {
return /^(([1-9]?\d|1\d\d|2[0-4]\d|25[0-5])(\.(?!$)|$)){4}$/.test(str);
@ramazansancar
ramazansancar / esm-package.md
Created March 1, 2023 14:49 — forked from sindresorhus/esm-package.md
Pure ESM package

Pure ESM package

The package that linked you here is now pure ESM. It cannot be require()'d from CommonJS.

This means you have the following choices:

  1. Use ESM yourself. (preferred)
    Use import foo from 'foo' instead of const foo = require('foo') to import the package. You also need to put "type": "module" in your package.json and more. Follow the below guide.
  2. If the package is used in an async context, you could use await import(…) from CommonJS instead of require(…).
  3. Stay on the existing version of the package until you can move to ESM.
@ramazansancar
ramazansancar / command.sh
Created January 20, 2023 08:44
Windows App Update Command
winget upgrade --all
const fetch = require('node-fetch');
const { readFileSync, writeFileSync } = require('fs');
const filePath = "./radarrTorrents.json" // where to store info about current torrents being downloaded
const maxAcceptedDownloadTime = 6000000; // any torrent that takes longer than this time (in milliseconds) to download is abandonded
const maxFileSize = 4000000000 // any torrent greater than this size (in bytes) is exempt from the time limit restriction
const waitTime = 600000; // how much time (in milliseconds) to give the torrent to find peers and lower it's download time
const dateLocale = "en-GB";
const dateOptions = { dateStyle: 'short', timeStyle: 'short' };