Skip to content

Instantly share code, notes, and snippets.

View gerardmarquina's full-sized avatar
:shipit:

Gerard Marquina gerardmarquina

:shipit:
View GitHub Profile
@gerardmarquina
gerardmarquina / install.sh
Last active May 5, 2022 16:43
Install Neodatis Explorer on MacOS
#!/bin/bash
curl https://deac-ams.dl.sourceforge.net/project/neodatis-odb/NeoDatis%20ODB%20for%20Java/1.9/1.9.30/neodatis-odb-1.9.30.689.zip -o neodatis.zip
unzip neodatis.zip
cd neodatis-odb-1.9.30-689
sudo cp lib/looks-2.2.1.jar /usr/local/lib/looks.jar
sudo cp neodatis-odb-1.9.30.689.jar /usr/local/lib/neodatis-odb.jar
echo "java -cp /usr/local/lib/looks.jar:/usr/local/lib/neodatis-odb.jar org.neodatis.odb.gui.ODBExplorerMain" | sudo dd of=/usr/local/bin/neodbe.sh
sudo chmod +x /usr/local/bin/neodbe.sh
cd ..
rm neodatis.zip
@gerardmarquina
gerardmarquina / main.js
Created December 22, 2021 02:07
Express + mongoose app with simple query on get request with id parameter.
// load libraries
require('dotenv').config();
const express = require('express');
const mongoose = require('mongoose');
// start mongoose with the .env connection string
async function start() {
try {
await mongoose.connect(process.env.CONNECTION);
console.log('Mongoose started');
@gerardmarquina
gerardmarquina / new_eu4_dev_diary_bot.dpr
Last active April 18, 2019 16:51
Improved version of the previous dev diary bot.
{ program bot;
uses
Winapi.Windows, System.SysUtils, System.Variants, System.Classes,
System.StrUtils, System.Net.URLClient, System.Net.HttpClient,
System.Net.HttpClientComponent;
{$APPTYPE CONSOLE }
{ var
@gerardmarquina
gerardmarquina / eu4_dev_diary_bot.dpr
Created April 18, 2019 14:38
A pdx forum web scraper for new eu4 dev diary, posts it as discord message using webhooks.
//THIS IS CODED LIKE SHIT, ONLY TO BE USED TEMPORALY TIL REFACTORED
program bot;
uses
Winapi.Windows, System.SysUtils, System.Variants, System.Classes,
System.StrUtils, System.Net.URLClient, System.Net.HttpClient,
System.Net.HttpClientComponent;
{$APPTYPE CONSOLE}
@gerardmarquina
gerardmarquina / deletediscordmessages.js
Last active February 17, 2019 13:38
Fixed script to delete discord messages with new instructions provided because token is not present in localstorage anymore. Credits to "Niahoo" and "CarletonStuberg"
// Credits to https://gist.github.com/niahoo/c99284a8908cd33d59b4aff802179e9b and https://gist.github.com/CarletonStuberg/0c838a6248772c6fea1339ddad503cce
// Turn on Developer Mode under User Settings > Appearance > Developer Mode (at the bottom)
// Then open the channel you wish to delete all of the messages (could be a DM) and click the three dots on the far right on your last message.
// Click "Copy ID" and paste that instead of LAST_MESSAGE_ID.
// Open the console with control+shift+i
// Go to network tab
// Move between two channels
// You should see a new request that says something along the lines "messages?limit=50"
// Open the request and find the header "authorization" and copy the RequestHeaders (you can save the authorization token for later).