Skip to content

Instantly share code, notes, and snippets.

View RuyiLi's full-sized avatar
🐶
if id ex mem wb

Roy Li RuyiLi

🐶
if id ex mem wb
View GitHub Profile
@tdcosta100
tdcosta100 / WSL2GUIXvnc-en.md
Last active April 6, 2024 00:36
A tutorial to use GUI in WSL2 replacing original XServer by Xvnc, allowing WSL to work like native Linux, including login screen

WSL2 with GUI using Xvnc

In this tutorial, we will setup GUI in WSL2, and access it using VNC. No additional software outside WSL (like VcXsrv) is required, except, of course, a VNC Viewer (RealVNC, TightVNC, TigerVNC, UVNC, etc, all of them might work flawlessly).

The key component we need to install is tigervnc-standalone-server.

For this setup, I will use Ubuntu 20.04 LTS (Focal Fossa, unfortunately 22.04 does not work), and install GNOME Desktop. Since the key components aren't bound to Ubuntu or GNOME, you can use your favorite distro and GUI. Check the Sample screenshots section for examples.

So let's go. First, we need a working WSL2 installation.

@peltho
peltho / svelte.md
Last active April 2, 2024 07:43
Svelte cheatsheet
@xDimGG
xDimGG / app.js
Created October 15, 2017 19:07
Basic Discord OAuth2 Example
const { get, post } = require('snekfetch');
const express = require('express');
const btoa = require('btoa');
const app = express();
const cfg = {
id: 'get_one',
secret: 'get_one'
};
@joshbuchea
joshbuchea / semantic-commit-messages.md
Last active April 18, 2024 12:05
Semantic Commit Messages

Semantic Commit Messages

See how a minor change to your commit message style can make you a better programmer.

Format: <type>(<scope>): <subject>

<scope> is optional

Example

@jithatsonei
jithatsonei / pomfforretards.md
Last active June 12, 2023 07:22
Pomf For Retards

SETTING UP POMF FOR RETARDS

You're probably reading this because you're too dense to google "lamp stack setup" and read the Readme.md in the git repo. The readme sucks ass though, so if that's the reason i don't really blame you. For the sake of simplicity I'm going to be using Apache and Ubuntu 16.04. If you want an Nginx guide, go fuck yourself. Things in code text with gray backgrounds are code you're supposed to enter in your command line.

PREREQUISITES

A LAMP stack (Linux, Apache, MySQL, and PHP)

Node.js/NPM

@lopezjurip
lopezjurip / Caddyfile
Last active April 17, 2024 00:03
Fix Too Many Redirect error using Caddy + Cloudflare
www.mysite.com, mysite.com {
proxy / webapp:3000 {
proxy_header Host {host}
proxy_header X-Real-IP {remote}
proxy_header X-Forwarded-Proto {scheme}
}
gzip
tls your@email.com
}
@CMCDragonkai
CMCDragonkai / history_data_structures.md
Last active March 31, 2024 00:39
History Data Structures

History Data Structures

For stateful applications, there are 5 different ways of managing the history of state:

  • No History - Living in the moment. - Examples: Any stateful application that doesn't discards all previous states upon mutation.
  • Ad Hoc Snapshotting - Allows restoration to manually saved snapshots. - Examples: Memento Pattern.
  • Singleton - Only remembers the previous snapshot, where undoing the undo is just another undo. - Examples: Xerox PARC Bravo.
  • 1 Stack - Allows linear undo. - Examples: AtariWriter.
  • 2 Stack - Allows linear undo and redo. - Examples: Browser History, Microsoft Word, Adobe Photoshop.
@mdang
mdang / RAILS_CHEATSHEET.md
Last active April 13, 2024 15:36
Ruby on Rails Cheatsheet

Ruby on Rails Cheatsheet

Architecture

Create a new application

Install the Rails gem if you haven't done so before

@cjaoude
cjaoude / gist:fd9910626629b53c4d25
Last active April 4, 2024 18:17
Test list of Valid and Invalid Email addresses
Use: for testing against email regex
ref: http://codefool.tumblr.com/post/15288874550/list-of-valid-and-invalid-email-addresses
List of Valid Email Addresses
email@example.com
firstname.lastname@example.com
email@subdomain.example.com
firstname+lastname@example.com
@cobyism
cobyism / gh-pages-deploy.md
Last active April 18, 2024 13:44
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).