Skip to content

Instantly share code, notes, and snippets.

View Jengas's full-sized avatar
🥔
Looking at potato

Jengas

🥔
Looking at potato
View GitHub Profile
@Jengas
Jengas / index.js
Last active November 9, 2023 14:30
Clear gitlab.com job artifacts (including job.log)
import axios from 'axios';
import pLimit from 'p-limit';
const PROJECT_ID = "idhere";
const TOKEN = "tokenhere";
const GITLAB_INSTANCE = "gitlab.com";
const PER_PAGE = 100;
let page = 1;
const limit = pLimit(8); // Limit the number of parallel requests to 8
@Jengas
Jengas / config.php
Created June 2, 2018 12:38
PHP + XML + COOKIES language system
<?php
ini_set('display_errors', 1);
error_reporting(E_ALL);
// Languages used to generate menus and for template translations
$languages = [
['id' => 'en', 'title' => 'English', 'icon' => 'US'],
['id' => 'es', 'title' => 'ESPAÑOL'],
['id' => 'ru', 'title' => 'РУССКИЙ'],
@Jengas
Jengas / index.php
Last active March 26, 2024 21:40
Discord oauth2 example PHP
<?php
ini_set('display_errors', 1);
ini_set('display_startup_errors', 1);
ini_set('max_execution_time', 300); //300 seconds = 5 minutes. In case if your CURL is slow and is loading too much (Can be IPv6 problem)
error_reporting(E_ALL);
define('OAUTH2_CLIENT_ID', '1234567890');
define('OAUTH2_CLIENT_SECRET', 'verysecretclientcode');