Skip to content

Instantly share code, notes, and snippets.

View alpgul's full-sized avatar

Alptekin Gülcan alpgul

View GitHub Profile
// 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
@alpgul
alpgul / ffmpeg_tuts.md
Created August 3, 2021 15:31 — forked from tingplenting/ffmpeg_tuts.md
ffmpeg cli for youtube

Extract audio from a YouTube video file

ffmpeg -i INPUT.mp4 -ab 256k OUTPUT.mp3

Cut 3s length

ffmpeg -y -ss 00:00:03 -i INPUT.mp4 -codec copy OUTPUT.mp4
@alpgul
alpgul / rea_background.js
Last active May 6, 2023 00:22
Tampermonkey rea/background.js GM_screenShot
'use strict';
( t => {
const h = t.FEATURES;
t.extend( {
extension: {
onConnect: {
addListener: function ( a ) {
return chrome.runtime.onConnect.addListener( a )
}
},