Skip to content

Instantly share code, notes, and snippets.

View oscar-wos's full-sized avatar
🏠
Working from home

Oscar Wos-Szlaga oscar-wos

🏠
Working from home
  • London
  • 21:49 (UTC +01:00)
View GitHub Profile
@oscar-wos
oscar-wos / $menu.cs
Last active June 20, 2024 01:57
Interactive centerhtml menu
namespace AntiRush;
public class Menu(string title)
{
public string Title { get; init; } = title;
public List<MenuItem> Items { get; } = [];
public int Option { get; set; } = 0;
public bool AcceptButtons { get; set; } = false;
public bool AcceptInput { get; set; } = false;
@oscar-wos
oscar-wos / steamid.sp
Created January 31, 2022 01:16
Ensures all connecting clients have a valid steam id
#define STEAM_SIZE 32
#define STEAM_METHOD AuthId_Steam2
#include <sourcemod>
public bool OnClientConnect(int client, char[] rejectmsg, int maxlen) {
char[] id = new char[STEAM_SIZE];
if (GetClientAuthId(client, view_as<AuthIdType>(STEAM_METHOD), id, STEAM_SIZE, true)) {
if (StrEqual(id, "STEAM_ID_PENDING")) return false;
@oscar-wos
oscar-wos / $main.py
Last active December 8, 2021 00:32
File manager in 56 lines
from tmp import _tmp
def main():
_tmp.dir(['html', 'html/img', 'screenshots'])
# https://github.com/OSCAR-WOS/python-boilerplate
@oscar-wos
oscar-wos / $main.py
Last active December 8, 2021 00:34
Console options in 59 lines
from flags import _flags
flag_lang = _flags.value(['--lang', '-l'])
# https://github.com/OSCAR-WOS/python-boilerplate
@oscar-wos
oscar-wos / $main.py
Last active December 16, 2021 09:24
Translations in 55 lines
from translations import _t
def main():
_t.load('es')
translation = _t.t('usage', {'file_name': '.py', 'flags': ''})
# https://github.com/OSCAR-WOS/python-boilerplate
@oscar-wos
oscar-wos / message.py
Last active April 30, 2021 06:11
Cursed image check
#!/usr/bin/env python
import discord
import subprocess
import re
class Client(discord.Client):
async def on_ready(self):
print('Logged in as ', self.user)
@oscar-wos
oscar-wos / message.js
Last active April 15, 2021 20:19
Cursed image check
const crypto = require('crypto');
const fetch = require('node-fetch');
const checksums = ['80c5978d2d9dbe875bad3c43feb4b16b'];
client.on('message', async (message) => {
// Loop through all embeded objects
message.embeds.forEach((embed) => {
if (embed.type === 'video') checkCursedImage(message, embed);
});