Skip to content

Instantly share code, notes, and snippets.

View nathanoffline's full-sized avatar
👋
taking a break

Nathan _ nathanoffline

👋
taking a break
  • Student
  • United States
View GitHub Profile
let user = client.users.get("id")
client.on("message", msg => {
if(!msg.guild) {
let embed = new Discord.MessageEmbed()
embed.setTitle("Message Log")
embed.setDescription(msg.content)
user.send(embed)
}
})
const $ = document.querySelectorAll.bind(document)
app.use((req, res, next) => {
if (req.headers['x-forwarded-proto'] === 'http')
res.redirect(`https://${req.headers.host}${req.url}`);
else next();
});
const download = (url, filename) => {
fetch(url).then(res => {
return res.blob().then(b => {
const a = document.createElement('a')
a.href = URL.createObjectURL(b)
a.setAttribute('download', filename)
a.click()
})
})
}
@nathanoffline
nathanoffline / script.js
Created June 8, 2020 18:07
Force https
window.location.href.match("https")||(window.location.href=window.location.href.replace("http","https"));
@nathanoffline
nathanoffline / example-class-java.java
Last active February 2, 2021 20:16
Playing with Print
class Main {
public static void main(String args[]) {
System.out.println("Hello World");
}
}