Skip to content

Instantly share code, notes, and snippets.

View reslear's full-sized avatar
🎉

reslear

🎉
View GitHub Profile
@rameerez
rameerez / telegram-mtproxy.md
Last active April 25, 2024 18:13
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>
@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;
@sanjukurian
sanjukurian / eth.js
Created January 31, 2019 07:11
Create ETH wallet, make transaction, get balance etc using infura
import Web3 from 'Web3'
var Tx = require('ethereumjs-tx');
const web3 = new Web3(`https://rinkeby.infura.io/v3/` + config.infura_api_key);
const createWallet = async () => {
try {
web3.eth.accounts.create((err, createdAcc) => {
if (err === null)
return {success: true, data: {
addr: createdAcc.address,
@mjquinn21
mjquinn21 / Pause Media on AirPods Disconnect.rtf
Last active April 18, 2021 16:17
Applescript to pause media from YouTube and Spotify. Works with Google Chrome for YouTube and Chrome and the desktop client for Spotify. Useful to run with Tooth Fairy to pause music when AirPods are disconnected.
How to Use This Script
1. Open Finder
2. Hit ⌘⇧L (Command + Shift + L)
3. Locate the Scripts folder
4. Move Stop_Media_When_AirPods_Disconnect_For_Tooth_Fairy.scpt to ~/Library/Scripts/
5. Open Tooth Fairy preferences
6. Select your AirPods and click “Advanced”
7. Make sure that “Run shell script after disconnecting” is ticked
8. Paste this in there:
@laris
laris / unpack-extract-deb-macos.md
Last active January 13, 2024 16:58
unpack-extract-deb-macos.md
@toioski
toioski / script.applescript
Last active June 5, 2023 01:30
Automatically Open Safari Dev Tools for iOS Simulator
-- `menu_click`, by Jacob Rus, September 2006.
-- Ref: https://stackoverflow.com/questions/14669542/automatically-open-the-safari-debugger-when-the-iphone-simulator-is-launched
on menu_click(mList)
local appName, topMenu, r
-- Validate our input
if mList's length < 3 then error "Menu list is not long enough"
-- Set these variables for clarity and brevity later on