This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import java.text.SimpleDateFormat; | |
| import java.util.*; | |
| public class Main { | |
| static void printBonusDatesBetween(int fromYear, int toYear) { | |
| SimpleDateFormat format1 = new SimpleDateFormat("yyyy-MM-dd"); | |
| Calendar cal = Calendar.getInstance(); | |
| cal.set(fromYear, 0, 1); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function hexToDouble1(num){//expensive | |
| const splittedNum = num.match(/../g); | |
| const buf = new ArrayBuffer(8); | |
| const view = new DataView(buf); | |
| splittedNum.forEach(function (val, index) { | |
| view.setInt8(index, parseInt(val, 16)); | |
| }); | |
| return view.getFloat64(0, 0); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const discord_permissions = [["CREATE_INSTANT_INVITE",1],["KICK_MEMBERS *",2],["BAN_MEMBERS *",4],["ADMINISTRATOR *",8],["MANAGE_CHANNELS *",16],["MANAGE_GUILD *",32],["ADD_REACTIONS",64],["VIEW_AUDIT_LOG",128],["PRIORITY_SPEAKER",256],["STREAM",512],["VIEW_CHANNEL",1024],["SEND_MESSAGES",2048],["SEND_TTS_MESSAGES",4096],["MANAGE_MESSAGES *",8192],["EMBED_LINKS",16384],["ATTACH_FILES",32768],["READ_MESSAGE_HISTORY",65536],["MENTION_EVERYONE",131072],["USE_EXTERNAL_EMOJIS",262144],["VIEW_GUILD_INSIGHTS",524288],["CONNECT",1048576],["SPEAK",2097152],["MUTE_MEMBERS",4194304],["DEAFEN_MEMBERS",8388608],["MOVE_MEMBERS",16777216],["USE_VAD",33554432],["CHANGE_NICKNAME",67108864],["MANAGE_NICKNAMES",134217728],["MANAGE_ROLES *",268435456],["MANAGE_WEBHOOKS *",536870912],["MANAGE_EMOJIS *",1073741824]]; | |
| discord_permissions.forEach(perm=>{ | |
| console.log(perm[0], (discord_user_guild_permissions & perm[1]) === perm[1]) | |
| }) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| //from https://stackoverflow.com/questions/65133851/uploading-file-to-discord-with-webhook-in-php | |
| //file is being called by a POST request in my case | |
| //print_r for debugging | |
| //default max size discord accepts is 8MB | |
| echo "<pre>"; | |
| $webhookurl = "https://discord.com/api/webhooks/xxxx/xxxxxxx"; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| // ini_set('display_errors', 1); | |
| // ini_set('display_startup_errors', 1); | |
| // error_reporting(E_ALL); | |
| //from https://stackoverflow.com/questions/65133851/uploading-file-to-discord-with-webhook-in-php | |
| //file is being called by a POST request in my case | |
| //print_r for debugging | |
| //default max size discord accepts is 8MB |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| /** | |
| * Lietuviškų vardų linksniai. | |
| * | |
| * @author Dainius Kaupaitis <dainius at kaupaitis dot lt> | |
| * @copyright Copyleft (ↄ) 2011, Dainius Kaupaitis | |
| * @version 1.0 | |
| * @package Vardai | |
| */ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // ==UserScript== | |
| // @name TTMAP WAYPOINT | |
| // @namespace TTMAP WAYPOINT | |
| // @match https://ttmap.eu/* | |
| // @version 1.0 | |
| // @author logan + nova | |
| // @downloadURL https://gist.github.com/sadboilogan/83c0effe25741607ccfc73ca83335c59/raw/ttools.user.js | |
| // @description Extends TTools site | |
| // ==/UserScript== |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| require("dotenv").config(); | |
| const AWS = require('aws-sdk'); | |
| const s3config = new AWS.Config({ | |
| credentials: new AWS.Credentials({ | |
| accessKeyId: process.env.accessKeyId, | |
| secretAccessKey: process.env.secretAccessKey | |
| }), | |
| region: 'nl-ams', | |
| endpoint: new AWS.Endpoint('https://s3.nl-ams.scw.cloud') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const axios = require("axios"); | |
| const FormData = require("form-data"); | |
| const webhook = "https://discord.com/api/webhooks/...."; | |
| //post message to discord channel via webhook | |
| module.exports = post_discord_log = async(message = "") => { | |
| if(!message || typeof message !== "string"){ | |
| return Promise.resolve(false); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const axios = require("axios"); | |
| const fs = require("fs"); | |
| const FormData = require("form-data"); | |
| const wait = (ms = 1000) => new Promise(resolve => setTimeout(resolve, ms)); | |
| const channelId = "---"; | |
| const botToken = "---"; | |
| const filesInDownloads = fs.readdirSync("./downloaded"); | |
| console.log(`Files: ${filesInDownloads.length}`); |