Skip to content

Instantly share code, notes, and snippets.

View alpgul's full-sized avatar

Alptekin Gülcan alpgul

View GitHub Profile
@alpgul
alpgul / mediaSource.html
Created May 26, 2024 15:28
MediaSource Demo
<!DOCTYPE html>
<html>
<head>
<title>MediaSource Demo</title>
</head>
<body>
<script>
const video = document.createElement("video");
document.body.append(video);
video.autoplay = true;
@alpgul
alpgul / async.defer.md
Last active May 22, 2024 13:29
async vs defer script loading JavaScript
Özellik Runtime onreadystatechange DOMContentLoaded onload rAF
Inline/Src loading interactive/complete interactive complete complete
Async interactive complete - complete interactive / complete (yavaş bağlantı)
Defer interactive complete interactive complete complete
Dinamik Ekleme (src/async/defer) interactive complete - complete interactive / complete (yavaş bağlantı)
Inline interactive - interactive complete complete

Async Script:

// mqtt örneği
// mqtt paketini dahil edin
const mqtt = require('mqtt');
// Broker'a bağlanın
const client = mqtt.connect('mqtt://test.mosquitto.org'); // Örnek olarak, test.mosquitto.org üzerindeki ücretsiz bir MQTT broker kullanılabilir
// Bağlandığında gerçekleşecek olayı dinleyin
client.on('connect', () => {
@alpgul
alpgul / mutexes.ts
Created February 11, 2024 19:20 — forked from GavinRay97/mutexes.ts
TypeScript Node.js/Browser Mutex + Read-Write Mutex using Atomics
class AsyncLock {
private _lock = new Int32Array(new SharedArrayBuffer(4)) // SharedArrayBuffer for multi-threading, 4 bytes for 32-bit integer
static INDEX = 0
static UNLOCKED = 0
static LOCKED = 1
lock() {
while (true) {
console.log("lock")
@alpgul
alpgul / proxifier-keygen.js
Created November 9, 2023 10:22
Proxifier Keygen
function createExpDate(year, month) {
const expDate = (year - 2000) * 12 + month - 1;
}
function createRndNumber(min, max) {
return Math.floor(Math.random() * (max - min + 1)) + min;
}
function CompileString(str) {
result = new Uint32Array(1);
@alpgul
alpgul / debugMsg.ahk
Created September 13, 2022 05:31
AHK Debug Message
DebugMessage(str)
{
global h_stdout
DebugConsoleInitialize() ; start console window if not yet started
str .= "`n" ; add line feed
DllCall("WriteFile", "uint", h_Stdout, "uint", &str, "uint", StrLen(str), "uint*", BytesWritten, "uint", NULL) ; write into the console
WinSet, Bottom,, ahk_id %h_stout% ; keep console on bottom
}
DebugConsoleInitialize()
@alpgul
alpgul / main.c
Last active March 24, 2022 15:34
WebAssembly Set/Get String - https://wasdk.github.io/WasmFiddle/
char a[20];
void setA(char b){
*a=b;
}
char getA(){
return *a;
}
int main() {
setA("atest");
@alpgul
alpgul / globalErrorHandler.js
Created September 28, 2021 11:55
Global Error Handler
(function(){
/**
* Capture error data for debugging in web console.
*/
var captures = [];
/**
* Wait until `window.onload`, so any external scripts
@alpgul
alpgul / odnoklassniki.js
Created August 10, 2021 19:41
Odnoklassniki Parser
// ==UserScript==
// @name odnoklassniki
// @namespace http://tampermonkey.net/
// @version 0.1
// @description try to take over the world!
// @author AlpGul
// @include *
// @grant none
// ==/UserScript==
@alpgul
alpgul / lgWebOsApps.md
Last active August 9, 2021 12:29
LG webOs Apps
Avg. Score
Image App ID App Name Category Deploy Date