Skip to content

Instantly share code, notes, and snippets.

View Wqrld's full-sized avatar
🌍
Discord: Wqrld#7373

Wqrld Wqrld

🌍
Discord: Wqrld#7373
View GitHub Profile
@Wqrld
Wqrld / discord_member_analysis.ipynb
Created April 27, 2023 11:16
discord_member_analysis
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
select SUM(amount) sum,DATE_FORMAT(STR_TO_DATE(date, '%d-%m-%Y %H:%i'), '%d-%m-%Y') as d
from Payments
WHERE (state = 'approved' or state = 'paid') and client != 1
group by d
order by sum DESC;
bash -c 'for ((i=1; i < 7; ++i)); do curl "https://api.github.com/users/Wqrld/starred?page=0&per_page=100" | jq .[].ssh_url; done' | sed 's/"//g' | xargs -L1 git clone
@Wqrld
Wqrld / mask.java
Created March 6, 2023 09:32
Subnet masks in java
public class Main {
public static void main(String[] args) {
int binary = 0x00;
for (int i = 0; i <= 32; i++) {
System.out.printf("%d.%d.%d.%d (/%d)%n", (binary >> 24) & 0xFF, (binary >> 16) & 0xFF, (binary >> 8) & 0xFF, binary & 0xFF, i);
binary >>= 1;
binary |= (1 << 31);
}
}
}
select sum(amount) as sum,username from Payments
JOIN Users on Users.id = Payments.client
where state = 'paid' OR state = 'approved'
group by username
order by sum desc
limit 50;
@Wqrld
Wqrld / libssl.md
Created February 6, 2023 09:03
mongodb libssl 22.04

wget http://archive.ubuntu.com/ubuntu/pool/main/o/openssl/libssl1.1_1.1.1-1ubuntu2.1~18.04.20_amd64.deb

dpkg -i libssl1.1_1.1.1-1ubuntu2.1~18.04.20_amd64.deb

and continue installing mongo

// DEV
boolean read = false;
while(!read) {
System.out.print((char) 27 + "[?1000h"); // enable mouse trap
try {
byte[] in = System.in.readNBytes(6);
StringBuilder sb = new StringBuilder();
if(in.length > 0) {
if(in[4] == ' ') {
System.out.println("down");
@Wqrld
Wqrld / churn.sql
Last active January 3, 2023 15:10
Some useful SQL stats (data-science-esque)
SELECT paymentcount, CONCAT(ROUND(((cnt - lag(cnt) over (ORDER BY paymentcount)) / lag(cnt) over (ORDER BY paymentcount)) * 100), '%')
as perc_change, cnt as cnt
from (SELECT COUNT(paymentcount) as cnt,paymentcount FROM
(select COUNT(*) as paymentcount From Payments JOIN Users on Users.id = Payments.client
where Users.id != 1 GROUP BY Users.id)
as a group by paymentcount) as b
\documentclass{article}
\usepackage{amsmath}
\usepackage{amssymb}
\usepackage{parskip}
\author{Or something \\ \small By Luc}
\title{Math by intuition}
\begin{document}
\begin{titlepage}
import json
from pathlib import Path
from random import SystemRandom
import ujson
from PIL import Image, ImageSequence
from loguru import logger as log
cwd = Path(__file__).parent