Skip to content

Instantly share code, notes, and snippets.

View H7-25's full-sized avatar

Filippo Cortigiani H7-25

View GitHub Profile
/* NickServ core functions
*
* (C) 2003-2021 Anope Team
* Contact us at team@anope.org
*
* Please read COPYING and README for further details.
*
* Based on the original code of Epona by Lara.
* Based on the original code of Services by Andy Church.
*/
const http = require('http');
const { exec } = require('child_process');
const mysql = require('mysql');
const jsonRpc = require('jayson');
const fetch = require('node-fetch');
// Read configuration from file
const config = require('./example.conf');
// Create MySQL connection pool
<template id="radio-controls">
<div class="radio-controls">
<div class="radio-controls-buttons">
<div class="radio-controls-button" @click="skipStation(-1)" title="Previous Station">
<i class="fa fa-fast-backward" aria-hidden="true"></i>
</div>
<div v-if="playerPlaying" class="radio-controls-button" @click="pauseStation()" title="Pause">
<i class="fa fa-pause" aria-hidden="true"></i>
</div>
<div v-else class="radio-controls-button" @click="playStation()" title="Play">
@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'
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);
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:
@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 / {
@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++)
# g_cap.tcl - IRCv3 capability negotiation and SASL support
# (c) 2013-2016 Mantas Mikulėnas <grawity@gmail.com>
# 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:
# g_base64.tcl - Base64 encoding/decoding routines
# (c) 2013 Mantas Mikulėnas <grawity@gmail.com>
# 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} {