Skip to content

Instantly share code, notes, and snippets.

View jozsefsallai's full-sized avatar

József Sallai jozsefsallai

View GitHub Profile
@jozsefsallai
jozsefsallai / readme.md
Created March 22, 2024 18:13
Discord.js slash command builder with user app command support

Just import your own SlashCommandBuilder instead of the one from discord.js. Then you can do this:

const meta = new SlashCommandBuilder()
  .setName('sandwich')
  .setDescription('Makes a sandwich')
  .setIntegrationTypes(AppIntegrationType.GuildInstall, AppIntegrationType.UserInstall);

As per Discord spec, commands will only have the GuildInstall integration type, if none specified.

@jozsefsallai
jozsefsallai / SETUP.md
Last active July 23, 2022 10:58
Debian Sid server setup cheatsheet

Debian Sid server setup cheatsheet

1. Generate an SSH key on your local machine (if you don't have one already):

ssh-keygen -t rsa -b 4096 -C "My key"

2. Copy the public key:

cat ~/.ssh/id_rsa.pub

Keybase proof

I hereby claim:

  • I am jozsefsallai on github.
  • I am joexyz (https://keybase.io/joexyz) on keybase.
  • I have a public key ASBqze079YfBgehtrtqGthnEo5oTnHTjMVswgRoqqH0V8go

To claim this, I am signing this object:

@jozsefsallai
jozsefsallai / gh-pages-deploy.md
Created March 15, 2019 22:18 — forked from cobyism/gh-pages-deploy.md
Deploy to `gh-pages` from a `dist` folder on the master branch. Useful for use with [yeoman](http://yeoman.io).

Deploying a subfolder to GitHub Pages

Sometimes you want to have a subdirectory on the master branch be the root directory of a repository’s gh-pages branch. This is useful for things like sites developed with Yeoman, or if you have a Jekyll site contained in the master branch alongside the rest of your code.

For the sake of this example, let’s pretend the subfolder containing your site is named dist.

Step 1

Remove the dist directory from the project’s .gitignore file (it’s ignored by default by Yeoman).

@jozsefsallai
jozsefsallai / sample.conf
Created December 2, 2018 10:49
nginx config for Vue SPA (built with vue-cli-service)
server {
listen 80;
server_name yourdomain.ex;
root /path/to/spa/dist/;
error_log /var/log/nginx/error.log;
access_log /var/log/nginx/access.log;
index index.html;
location / {
try_files $uri $uri/ /index.html;
@jozsefsallai
jozsefsallai / node-for-all-users.md
Last active May 24, 2021 08:56
Easiest method to make node and npm work for all users (non-root too). User-based global packages can also be installed by any user using this method.

Node and npm for all users (in 3 easy steps)

Warning! These instructions are mainly for Ubuntu and Debian. There are probably similar ways of accomplishing the exact same thing in other distros as well.

  1. If you want to install node and npm for all users, even users who don't have admin privileges, first you need to install them as a root (sudo) user.
sudo apt update
sudo apt upgrade
sudo apt install curl build-essential
@jozsefsallai
jozsefsallai / GoHTML.sublime-syntax
Last active July 26, 2024 19:17
Go HTML template syntax highlighting for Sublime Text
%YAML 1.2
---
name: 'GoHTML'
file_extensions:
- gohtml
- html.go
scope: text.html.gohtml
contexts:
main:
- match: ''