Skip to content

Instantly share code, notes, and snippets.

View reslear's full-sized avatar
🎉

reslear

🎉
View GitHub Profile
export function detangle() {
let blocked = false
return callback => (...args) => {
if (blocked) return
blocked = true
callback(...args)
@jahirfiquitiva
jahirfiquitiva / settings.json
Created May 11, 2024 22:32
VS Code Settings
{
"breadcrumbs.enabled": false,
"editor.fontFamily": "'MonoLisa', 'Dank Mono', 'Operator Mono Lig', 'Operator Mono', Menlo, Monaco, 'Courier New', monospace",
"editor.fontWeight": "400",
"editor.cursorBlinking": "smooth",
"editor.cursorSmoothCaretAnimation": "explicit",
"editor.stickyScroll.enabled": true,
"explorer.sortOrder": "type",
"workbench.editor.enablePreview": false,
"workbench.editor.highlightModifiedTabs": true,
@rameerez
rameerez / telegram-mtproxy.md
Last active August 23, 2025 11:32
Telegram Proxy How-To: complete and up-to-date MTProxy tutorial

How to set up a Telegram Proxy (MTProxy)

This tutorial will teach you how to set up a Telegram MTProxy on an Ubuntu 22.04 sever using AWS Lightsail, although you can use any other Linux distribution and cloud provider.

Using a Telegram proxy is a safe, easy and effective way of overcoming Telegram bans. It's useful, for example, to keep using Telegram under tyrannical regimes, or to circumvent judges' decisions to block Telegram.

Telegram proxies are a built-in feature in all Telegram apps (both mobile and desktop). It allows Telegram users to connect to a proxy in just one or two clicks / taps.

Telegram proxies are safe: Telegram sends messages using their own MTProto secure protocol, and the proxy can only see encrypted traffic – there's no way for a proxy to decrypt the traffic and read the messages. The proxy does not even know which Telegram users are using the proxy, all the proxy sees is just a list of IPs.

@dbarjs
dbarjs / usePersistentQueries.ts
Last active October 1, 2023 20:15
usePersistentQuery - a @vueuse composable proposal
import type { TupleToUnion } from 'type-fest';
import type { UsePersistentQueryOptions } from './usePersistentQuery';
import { usePersistentQuery } from './usePersistentQuery';
import { useRoute } from '#vue-router';
export function usePersistentQueries<
TKeys extends readonly string[],
TReturn = Record<TupleToUnion<TKeys>, Ref<string>>,
let scrollWidth: null | number = null;
export const getScrollWidth = (): number => {
if (scrollWidth !== null) {
return scrollWidth;
}
const el = document.createElement('div');
el.style.position = 'fixed';
el.style.zIndex = '-1';
@anthonygore
anthonygore / Counter.vue
Last active June 9, 2021 05:50
Vue Composition API + RxJS counter
<template>
<div>
<input v-model="input" type="number" />
<h1>{{ output }}</h1>
</div>
</template>
<script>
import { ref, watch, onUnmounted } from 'vue';
import { timer, Subject } from 'rxjs';
@Akryum
Akryum / responsive-menu.html
Created January 6, 2021 15:22
Tailwind negate responsive breakpoints
<div class="flex !md:flex-col items-center !md:space-y-6 md:space-x-6">
<button>Menu button 1</button>
<button>Menu button 2</button>
<button>Menu button 3</button>
</div>
@paulnbrd
paulnbrd / babelEdit_trial_bypass.py
Last active September 26, 2024 13:14
Trial of BabelEdit expired ? Execute this program, and the trial will be renewed !
import os
try :
import winreg
except :
print("You need winreg.")
print("(pip install winregistry)")
os._exit(0)
REG_PATH = r"SOFTWARE\code-and-web.de\BabelEdit\licensing"
def set_reg(name, value):
try:
@fredsced
fredsced / api.js
Created April 26, 2019 20:14
JWT authentication handler using Axios interceptors. It refreshes access token on the fly when backend API throws out a 401 error. Multiple requests at the same time supported.
import axios from 'axios';
import JWTDecode from 'jwt-decode';
import { AuthApi } from './auth.api';
import { config } from '../config';
const { API_ENDPOINT } = config[process.env.NODE_ENV];
axios.defaults.baseURL = API_ENDPOINT;
axios.defaults.timeout = 7000;
@Gustavo-Kuze
Gustavo-Kuze / force-ctrl-c-v.md
Last active August 16, 2025 00:28
Enable copy and paste in a webpage from the browser console
javascript:(function(){
  allowCopyAndPaste = function(e){
  e.stopImmediatePropagation();
  return true;
  };
  document.addEventListener('copy', allowCopyAndPaste, true);
  document.addEventListener('paste', allowCopyAndPaste, true);
  document.addEventListener('onpaste', allowCopyAndPaste, true);
})();