Skip to content

Instantly share code, notes, and snippets.

@rigwild
rigwild / ytdl-core-server.js
Last active July 5, 2018 12:15
Get MP4/OGG download links from Youtube videos. A little ytdl-core server implementation (https://github.com/fent/node-ytdl-core).
const http = require('http');
const ytdl = require('ytdl-core');
const getInfo = async youtubeUrl => {
const data = await ytdl.getInfo(youtubeUrl);
let result = {
id: data.video_id,
url: data.video_url,
title: data.title,
description: data.description,
@rigwild
rigwild / create_web_project.js
Last active July 10, 2018 15:33
Quickly create a web project with node.
/*
## Usage :
node create_web_project.js projectName
*/
'use strict'
const fs = require('fs')
if (process.argv.length <= 2) {
@rigwild
rigwild / loginCookie.php
Last active August 15, 2018 16:28
A PHP secure login cookie system
<?php
$connexion = new PDO('mysql:host=' . $host . ';port=' . $port . ';dbname=' . $dbname, $user, $pass);
$connexion->setAttribute(PDO::ATTR_EMULATE_PREPARES, false);
$connexion->setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION);
// Cookie session validity duration (Default = 2 weeks)
$cookieSessionTimeout = 3600 * 24 * 14;
function createLoginCookie()
{
@rigwild
rigwild / Database.class.php
Last active June 20, 2019 08:38
a simple PHP-PDO database class
<?php
require_once 'DatabaseConfig.class.php';
/**
* Easily communicate with your database.
*
* Usage :
* $dbLink = new Database();
*
@rigwild
rigwild / pass-acme-challenge.sh
Created August 31, 2018 12:25
Quickly validate a ACME Challenge for SSL certs validation
mkdir .well-known .well-known/acme-challenge
php -S www.your.domain.to.validate.com:80
# Simply set a DNS A pointing to the server's IP and use this to pass the ACME Challenge
# to validate your SSL certificates.
@rigwild
rigwild / clean-microsoft-history.js
Last active March 3, 2019 15:05
Quickly remove all the activity history from a Microsoft Account.
// Go to https://account.microsoft.com/privacy/activity-history
// Select "All activities" on the left panel.
// Open your browser's dev tools (F12), got to the console tab.
// Paste this script, it will load all the history elements and delete all activity.
// If you get spammed by errors in the console, turn your adblocker off temporarily.
// You will probably need to refresh the page and execute this script multiple times :
// The page is (IMHO) intentionnaly buggy to prevent people from deleting their data.
// Eventually everything will be clean.
[{"lineName":"1","lineData":{"direction1":[{"station":"ROND POINT D'OYE","schedule":{"weekDays":["06:50","07:06","07:50","08:29","08:45","09:18","09:55","10:30","11:06","11:43","12:20","12:58","13:33","14:07","14:37","15:10","15:40","16:14","16:45","17:17","17:48","18:16","18:51","19:22","19:45","19:56"]}},{"station":"AERODROME","schedule":{"weekDays":["07:03*","07:33","08:11","08:58","09:34","10:12","10:46","11:22","11:58","12:37","13:10","13:47","14:22","14:50","15:22","15:54","16:28","16:58","17:30","18:02","18:28","19:03","19:30","20:00","20:08"]}},{"station":"MAIRIE DE MARCK","schedule":{"weekDays":["07:05*","07:35","08:13","09:00","09:36","10:14","10:48","11:24","12:00","12:39","13:12","13:49","14:24","14:52","15:24","15:56","16:30","17:00","17:32","18:04","18:30","19:05","19:32","20:02","20:10"]}},{"station":"SCHWEITZER","schedule":{"weekDays":["06:55","07:11","07:56","08:35","08:51","09:24","10:01","10:36","11:12","11:49","12:26","13:04","13:39","14:13","14:43","15:16","15:46","16:20","16:51","17:23",
@rigwild
rigwild / selfbot.js
Last active April 9, 2022 20:37
This has moved to https://github.com/rigwild/discord-self-bot-console --- A simple Discord Self-bot using console
// Due to some interest, I created a proper repo.
// Check it out! :)
// https://github.com/rigwild/discord-self-bot-console
@rigwild
rigwild / twitter_emojis.json
Last active November 3, 2018 21:26
All twitter emojis
[{t:"Visage rigolard",url:"https://abs.twimg.com/emoji/v2/72x72/1f600.png"},{t:"Visage souriant avec la bouche ouverte",url:"https://abs.twimg.com/emoji/v2/72x72/1f603.png"},{t:"Visage souriant avec la bouche ouverte et les yeux rieurs",url:"https://abs.twimg.com/emoji/v2/72x72/1f604.png"},{t:"Visage rigolard avec des yeux rieurs",url:"https://abs.twimg.com/emoji/v2/72x72/1f601.png"},{t:"Visage souriant avec la bouche ouverte et les yeux bien fermés",url:"https://abs.twimg.com/emoji/v2/72x72/1f606.png"},{t:"Visage souriant avec la bouche ouverte et une sueur froide",url:"https://abs.twimg.com/emoji/v2/72x72/1f605.png"},{t:"Visage avec des larmes de joie",url:"https://abs.twimg.com/emoji/v2/72x72/1f602.png"},{t:"Mort de rire à s'en rouler par terre",url:"https://abs.twimg.com/emoji/v2/72x72/1f923.png"},{t:"Visage souriant avec un halo",url:"https://abs.twimg.com/emoji/v2/72x72/1f607.png"},{t:"Visage faisant un clin d'œil ",url:"https://abs.twimg.com/emoji/v2/72x72/1f609.png"},{t:"Visage souriant avec des yeux
@rigwild
rigwild / discord_emojis.json
Last active December 2, 2022 12:19
Discord emojis list
{
":100:": "💯",
":1234:": "🔢",
":8ball:": "🎱",
":a:": "🅰",
":ab:": "🆎",
":abc:": "🔤",
":abcd:": "🔡",
":accept:": "🉑",
":adult:": "🧑",