Skip to content

Instantly share code, notes, and snippets.

View belmer's full-sized avatar

Belmer Salonoy belmer

View GitHub Profile
Copy and save this file as SpaceGray.terminal
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>ANSIBlackColor</key>
<data>
YnBsaXN0MDDUAQIDBAUGFRZYJHZlcnNpb25YJG9iamVjdHNZJGFyY2hpdmVyVCR0b3AS
AAGGoKMHCA9VJG51bGzTCQoLDA0OVU5TUkdCXE5TQ29sb3JTcGFjZVYkY2xhc3NGMCAw
IDAAEAKAAtIQERITWiRjbGFzc25hbWVYJGNsYXNzZXNXTlNDb2xvcqISFFhOU09iamVj
@belmer
belmer / quote-request.md
Created October 19, 2021 01:28
Items/quote request error
Content root path: /Users/mr.b/Documents/Projects/SDK_Sandbox/Sandbox
fail: Microsoft.AspNetCore.Server.Kestrel[13]
      Connection id "0HMCIJOIKPR95", Request id "0HMCIJOIKPR95:00000001": An unhandled exception was thrown by the application.
System.NullReferenceException: Object reference not set to an instance of an object.
   at Navitaire.TC.Universal.Sandbox.Controllers.ItemsController.ItemQuote(QuoteRequestV2 request) in C:\Git-Projects\Tools\Navitaire.TC.Stubs\Navitaire.TC.Universal.Sandbox\Controllers\ItemsController.cs:line 200
   at lambda_method(Closure , Object , Object[] )
   at Microsoft.Extensions.Internal.ObjectMethodExecutor.Execute(Object target, Object[] parameters)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ActionMethodExecutor.SyncActionResultExecutor.Execute(IActionResultTypeMapper mapper, ObjectMethodExecutor executor, Object controller, Object[] arguments)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.InvokeActionMethodAsync()
@belmer
belmer / openrgb.md
Last active September 25, 2021 06:09
OpenRGB on Linux with MSI motherboard

This document is to highlights the steps to make OpenRGB work on Linux with MSI Motherboard. This is actually the general process for all motherboard that are supported on OpenRGB but few notes I found that works on my MSI motherboard.

Download OpenRGB

OpenRGB project repository

Details on my machine

  • MSI X570 Gaming edge wifi
  • 32GB GSkill TridentZ Neo
@belmer
belmer / laggywindow.md
Last active August 26, 2021 01:30
Fix Laggy window on Popos

Fix Laggy window dragging on PopOs

This is only happening on Nvidia GPU as far as I know.

  1. Open terminal and run sudo nvidia-settings.
  2. On the settings, select X Server Display Configuration
  3. Select one monitor from the display.
  4. At the bottom, open Advance
  5. Then tick or enable Force composition pipeline
  6. Do this for all of your monitors.
@belmer
belmer / bmachine.md
Last active September 6, 2021 04:32
Linux Machine Setup {mr.b}

My General OS Setup

Before doing all of these, make sure to have a backup of everything and if your using VsCode make sure you use settings sync. It will sync up all of your settings obviously and all configurations. This will be very convenient on moving from one system to the other.

  1. Download & Install PopOS (https://pop.system76.com/) Essential Apps
  • VsCode/Sublime
  • Blender
  • Flameshot
@belmer
belmer / jsTips.md
Created April 1, 2021 12:52
Useful javascript tips

IIFE

const increaseCounter = (function() {
  let counter = 0;
 
  return function() {
    counter = counter + 1;
    console.log(counter);
  };
})();
@belmer
belmer / useReducer.md
Last active April 1, 2021 12:47
useReducer hook instead of useState
// This is gross and hard to read
const BasicComponent = () => {
  const [isOpen, setIsOpen] = useState(false);
  const [name, setName] = useState('');
  const [isLoading, setIsLoading] = useState(false);
  const [error, setError] = useState(null);
  const [id, setid] = useState('');
  
 return (
@belmer
belmer / EventHandler-v.s-EventListener.md
Last active March 22, 2021 05:57
What is the difference between Event handler and addEvenListener

What’s the difference?

There’s a subtle, but important difference between these 2 methods of handling events. If you’ll use the first method, event handlers, the difference is that if you add two event handlers for the same button click, the second event handler will overwrite the first and only that event will trigger. Which takes us to the main learning: For a given element, you can only have one event handler per event type, but you can have multiple event listeners.

Example

Event handler

@belmer
belmer / JavaScript One-Liners.md
Last active March 22, 2021 05:42
JavaScript One-Liners

1. Get a random boolean (true/false)

const randomBoolean = () => Math.random() >= 0.5;
console.log(randomBoolean());
// Result: a 50/50 change on returning true of false

2. Check if the provided day is a weekday

const isWeekday = (date) =&gt; date.getDay() % 6 !== 0;
@belmer
belmer / Default%20%28Linux%29.sublime-keymap
Created March 18, 2021 23:15
Sumblime Sync ubuntu 2021
[
{
"keys": ["/"],
"command": "close_tag",
"args": { "insert_slash": true },
"context": [
{
"key": "selector",
"operator": "equal",
"operand": "(text.html, text.xml, meta.jsx.js) - string - comment",