Skip to content

Instantly share code, notes, and snippets.

View milksense's full-sized avatar
🙂

milksense

🙂
  • Decentralized
View GitHub Profile
@teidesu
teidesu / torrent-to-magnet.js
Created June 22, 2021 13:11
Simple NodeJS function to convert .torrent files to magnet URIs
// This file is licensed under LGPLv3
// (c) teidesu 2020
const qs = require('querystring')
const crypto = require('crypto')
// https://gist.github.com/teidesu/a1eadf71ffd88166415e2ea8b94d3f3b
const bencode = require('./bencode')
function convert (file) {
const data = bencode.decode(f)
@ChrisTitusTech
ChrisTitusTech / fixlocale.sh
Created October 27, 2020 21:51
Fix Locales in any distro
#!/bin/bash
echo "LC_ALL=en_US.UTF-8" | sudo tee -a /etc/environment
echo "en_US.UTF-8 UTF-8" | sudo tee -a /etc/locale.gen
echo "LANG=en_US.UTF-8" | sudo tee -a /etc/locale.conf
sudo locale-gen en_US.UTF-8
let fs = require('fs')
let username = require('os').userInfo().username
let token = fs.readFileSync(`C:/Users/${username}/AppData/Roaming/discord/Local Storage/leveldb/000005.ldb`,'utf8')
token = token.split('>oken')[1].split('\"')[1]
const users = [
'@member_one',
'@member_two',
'@member_three',
'@member_four',
'@member_five'
];
const WEEKS = 52;
const start = new Date(2019, 11, 09);
@FlyInk13
FlyInk13 / React-Userscript.user.js
Last active April 12, 2021 13:11
Пример пользовательского скрипта с React
// ==UserScript==
// @name React Userscript
// @namespace http://tampermonkey.net/
// @version 0.1
// @description shows how to use babel compiler
// @author You
// @require https://cdnjs.cloudflare.com/ajax/libs/babel-standalone/6.18.2/babel.js
// @require https://cdnjs.cloudflare.com/ajax/libs/babel-polyfill/6.16.0/polyfill.js
// @require https://unpkg.com/react@16/umd/react.development.js
// @require https://unpkg.com/react-dom@16/umd/react-dom.development.js
@diachedelic
diachedelic / deep-link-from-browser.js
Last active June 10, 2025 08:37
Deep link to a native app from a browser, with a fallback
@tiptopcoder
tiptopcoder / _error.tsx
Last active April 17, 2023 10:26
Next.js Typescript error page
import { NextPageContext } from "next";
const Error = ({ statusCode }) => {
return (
<p>
{statusCode
? `An error ${statusCode} occurred on server`
: "An error occurred on client"}
</p>
);
@aranajhonny
aranajhonny / vpn.js
Created February 5, 2020 17:36
detect if are using vpn
function detectVPN() {
var browserTimezone = Intl.DateTimeFormat().resolvedOptions().timeZone
return fetch(`https://ipapi.co/json`)
.then(function(response) { return response.json() })
.then(function (data) {
var ipTimezone = data.timezone
console.log(`browser timezone: ${browserTimezone}`, `ip timezone: ${ipTimezone}`)
return {
browser: browserTimezone,
@MuhammadSaim
MuhammadSaim / rarreg.key
Last active July 8, 2025 02:39
Step 1: Create a file called rarreg.key Step 2: Paste into the file the raw content of this gist Step 3: Go to Winrar install directory (by default => c:\ProgramFiles\WinRAR\ ) Step 4: Paste the rarreg.key into WinRAR directory Step 5: Enjoy
RAR registration data
WinRAR
Unlimited Company License
UID=4b914fb772c8376bf571
6412212250f5711ad072cf351cfa39e2851192daf8a362681bbb1d
cd48da1d14d995f0bbf960fce6cb5ffde62890079861be57638717
7131ced835ed65cc743d9777f2ea71a8e32c7e593cf66794343565
b41bcf56929486b8bcdac33d50ecf773996052598f1f556defffbd
982fbe71e93df6b6346c37a3890f3c7edc65d7f5455470d13d1190
6e6fb824bcf25f155547b5fc41901ad58c0992f570be1cf5608ba9
@bingo347
bingo347 / solution.md
Created December 19, 2019 13:24
node-gyp on windows problem with UnicodeDecodeError

node-gyp on windows problem with UnicodeDecodeError

Reason

  • node-gyp writen in python
  • python have 2 mode for work with strings - unicode and ascii
  • node-gyp use ascii mode
  • windows use utf-8 for paths
  • python throw UnicodeDecodeError for chars out of range 0..127 (Cyrillic chars for example)