Skip to content

Instantly share code, notes, and snippets.

@avivace
avivace / telegramRestore.md
Last active March 6, 2024 16:09
Restore deleted Telegram messages from groups

Restore deleted Telegram messages, medias and files from groups

There's not telegram API method for this, we need to call MTProto methods to retrieve messages from the "Recent Actions" (Admin Log) since deleted messages (and medias) gets moved there for 48 hours before the permanent deletion.

from telethon import TelegramClient, events, sync
from telethon.tl.types import InputChannel, PeerChannel
@Katamori
Katamori / yt.sh
Created September 20, 2017 10:26 — forked from Silur/yt.sh
youtube viewer in bash
# usage ./yt.sh <https://youtube.com/watch?v=....>
urldecode() {
local url_encoded="${1//+/ }"
printf '%b' "${url_encoded//%/\\x}"
}
video_url="$1"
raw_url=$(curl \
-H 'Upgrade-insecure-requests: 1' \
-H 'Cache-control: max-age=0' \
-H 'Accept-language: en-US,en;q=0.8,bn;q=0.6' \
@Silur
Silur / yt.sh
Created September 20, 2017 10:24
youtube viewer in bash
# usage ./yt.sh <https://youtube.com/watch?v=....>
urldecode() {
local url_encoded="${1//+/ }"
printf '%b' "${url_encoded//%/\\x}"
}
video_url="$1"
raw_url=$(curl \
-H 'Upgrade-insecure-requests: 1' \
-H 'Cache-control: max-age=0' \
-H 'Accept-language: en-US,en;q=0.8,bn;q=0.6' \
@dmh2000
dmh2000 / bcrypt-promise.js
Last active May 18, 2021 09:58
Using bcrypt with promises to hash a password and then verify it
const bcrypt = require("bcrypt");
// use this library in case your version of node doesn't support Promise
// const Promise = require("promise");
let password = "hello";
let stored_hash = "";
// first generate a random salt
function genSalt(password) {
return new Promise((resolve, reject) => {
## How to hide API keys from github ##
1. If you have already pushed commits with sensitive data, follow this guide to remove the sensitive info while
retaining your commits: https://help.github.com/articles/remove-sensitive-data/
2. In the terminal, create a config.js file and open it up:
touch config.js
atom config.js
@shawncxc
shawncxc / client.html
Last active May 1, 2019 12:22 — forked from diorahman/client.html
Ajax, call jQuery POST to node.js expressjs
<html>
<head>
<title>jsonp test</title>
<script src="http://code.jquery.com/jquery-1.6.2.min.js"></script>
<script type="text/javascript">
$(function(){
$('#select_link').click(function(e){
e.preventDefault();
console.log('select_link clicked');
@nylki
nylki / char-rnn recipes.md
Last active March 16, 2024 15:13
char-rnn cooking recipes

do androids dream of cooking?

The following recipes are sampled from a trained neural net. You can find the repo to train your own neural net here: https://github.com/karpathy/char-rnn Thanks to Andrej Karpathy for the great code! It's really easy to setup.

The recipes I used for training the char-rnn are from a recipe collection called ffts.com And here is the actual zipped data (uncompressed ~35 MB) I used for training. The ZIP is also archived @ archive.org in case the original links becomes invalid in the future.

@rtt
rtt / tinder-api-documentation.md
Last active April 20, 2024 17:01
Tinder API Documentation

Tinder API documentation

Note: this was written in April/May 2014 and the API may has definitely changed since. I have nothing to do with Tinder, nor its API, and I do not offer any support for anything you may build on top of this. Proceed with caution

http://rsty.org/

I've sniffed most of the Tinder API to see how it works. You can use this to create bots (etc) very trivially. Some example python bot code is here -> https://gist.github.com/rtt/5a2e0cfa638c938cca59 (horribly quick and dirty, you've been warned!)

@geksilla
geksilla / bootsrap_class_list
Last active April 29, 2023 03:59
Bootstrap css class list
.navbar
.caret
.label
.table
.img-responsive
.img-rounded
.img-thumbnail
.img-circle
.sr-only
.lead
@DavidBruant
DavidBruant / ScreenTreeNode.js
Created August 25, 2013 21:36
2D BSP in JavaScript
(function(global){
"use strict";
function constEnumPropValueDesc(v){
return {
value: v,
enumerable: true,
configurable: false,
writable: false
};