Skip to content

Instantly share code, notes, and snippets.

View H7-25's full-sized avatar

Filippo Cortigiani H7-25

View GitHub Profile
@H7-25
H7-25 / m_filter.cpp
Created November 19, 2018 13:14
Revisited m_filter.cpp
/*
* InspIRCd -- Internet Relay Chat Daemon
*
* Copyright (C) 2009 Daniel De Graaf <[email protected]>
* Copyright (C) 2004, 2008 Craig Edwards <[email protected]>
* Copyright (C) 2007 Dennis Friis <[email protected]>
* Copyright (C) 2007 Robin Burchell <[email protected]>
*
* This file is part of InspIRCd. InspIRCd is free software: you can
* redistribute it and/or modify it under the terms of the GNU General Public
function randString(n) {
if(!n)
{
n = 5;
}
var text = '';
var possible = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
for(var i=0; i < n; i++)
<?php
$style = "include/style.php";
$js = "include/js.php";
$dom = new DOMDocument;
$dom->loadHTMLFile('/home/kiwi/public_html/index.html');
$head = $dom->getElementsByTagName('head')->item(0);
$css = $head->getElementsByTagName("link")->item(1);
$fh = fopen($style, 'w');
# g_base64.tcl - Base64 encoding/decoding routines
# (c) 2013 Mantas Mikulėnas <[email protected]>
# Released under the MIT Expat License.
if {![catch {package require Tcl 8.6}]} {
proc b64:encode {input} {
binary encode base64 $input
}
proc b64:decode {input} {
# g_cap.tcl - IRCv3 capability negotiation and SASL support
# (c) 2013-2016 Mantas Mikulėnas <[email protected]>
# Released under the MIT Expat License.
#
# Requires: g_base64.tcl
## Configuration -- set these in your eggdrop.conf
# Mechanism to use. (This may be a space-separated list of mechanisms to try.)
# Available mechs:
@H7-25
H7-25 / ident.js
Created January 7, 2021 13:31
kiwiirc identcookie plugin
function randString(n) {
if(!n)
{
n = 5;
}
var text = '';
var possible = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
for(var i=0; i < n; i++)
@H7-25
H7-25 / vhost
Created February 11, 2021 22:16
server {
listen 80;
listen [::]:80;
server_name radiocobra.it www.radiocobra.it;
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-Server $host;
proxy_set_header X-Real-IP $remote_addr;
location / {
version: '2.2'
services:
nginx_proxy:
volumes:
- /etc/letsencrypt/live/technomix.it/fullchain.pem:/etc/nginx/certs/technomix.it.crt:ro
- /etc/letsencrypt/live/technomix.it/privkey.pem:/etc/nginx/certs/technomix.it.key:ro
stations:
volumes:
module.exports.init = async function init(hooks, app) {
function sleep(ms) {
return new Promise(resolve => setTimeout(resolve, ms));
}
hooks.on('client_disconnected', async (event) => {
const con = event.client;
const user = await app.db.factories.User.query().where('id', con.state.authUserId).first();
const networks = await con.userDb.getUserNetworks(con.state.authUserId);
@H7-25
H7-25 / instantiate-uppy.js
Last active January 26, 2022 23:46
instantiate-uppy with puppy audio and translations
import Uppy from '@uppy/core'
import Dashboard from '@uppy/dashboard'
import Tus from '@uppy/tus'
import Webcam from '@uppy/webcam'
import Audio from '@zadkiel/uppy-audio'
import it_IT from '@uppy/locales/lib/it_IT'
import { KiB } from './constants/data-size'
import acquireExtjwtBeforeUpload from './handlers/uppy/acquire-extjwt-before-upload'
import { getValidUploadTarget } from './utils/get-valid-upload-target'