Skip to content

Instantly share code, notes, and snippets.

View vcfvct's full-sized avatar
👨‍💻
coding

leon vcfvct

👨‍💻
coding
View GitHub Profile
@armw4
armw4 / redux-is-smarter-than-you-think.md
Last active June 19, 2021 20:10
Optimizing your react components via redux....shouldComponentUpdate for free and more...

The Beginning

Yes...it's true...redux is smart....smarter than you even know. It really does want to help you. It strives to be sane and easy to reason about. With that being said, redux gives you optimizations for free that you probably were completely unaware of.

connect()

connect is the most important thing in redux land IMO. This is where you tie the knot between redux and your underlying components. You usually take state and propogate it down your component hiearchy in the form of props. From there, presentational

@elquimista
elquimista / combinations.js
Created November 23, 2016 03:00
Calculate combinations count in Javascript (ES5)
function combinationsCount(m, n) {
if (m < n) {
return 0;
} else if (m === n || n === 0) {
return 1;
} else {
var c = 1, i;
for (i = n + 1; i <= m; i ++) {
c *= i;
}
//▔▔▔▔▔▔▔▔▔▔
// ➤ NOTES
//▁▁▁
//
//
// Vivaldi keyboard shortcuts are preferred when they need to:
// ● work on browser chrome windows :- always available
// ● happen in an independent process, not blocked by page events :- faster, snappier
//
// Surfingkeys keyboard shortcuts are preferred otherwise as they:
import { OnDestroy } from '@angular/core';
import { Subject } from 'rxjs/Subject';
export abstract class BaseComponent implements OnDestroy {
protected destroyed$: Subject<boolean> = new Subject();
protected constructor() {}
ngOnDestroy(): void {
@emraher
emraher / SurfingkeysDraculaThemeAttempt.txt
Last active February 21, 2024 13:02
Surfingkeys Dracula Theme Attempt
// -----------------------------------------------------------------------------------------------------------------------
// // Surfingkeys: https://github.com/brookhong/Surfingkeys#properties-list
// // Dracula Theme: https://github.com/dracula/dracula-theme#color-palette
// -----------------------------------------------------------------------------------------------------------------------
// Map Keys
// -----------------------------------------------------------------------------------------------------------------------
// Change default search engine
//settings.defaultSearchEngine = "w";
// -----------------------------------------------------------------------------------------------------------------------
// Change hints styles
@y9c
y9c / surfingkeys_config.js
Last active November 20, 2023 03:14
surfingkeys_config.js
/*************************************************************
* File Name : surfingkeys_config.js
* Created By : Ye Chang
* Creation Date : [2017-12-22 21:55]
* Last Modified : [2023-11-19 13:35]
* Description :
**************************************************************/
// -----------------------------------------------------------------------------------------------------------------------
// - Surfingkeys: https://github.com/brookhong/Surfingkeys#properties-list
Jenkinsfile VIM syntax highlighting
echo 'au BufNewFile,BufRead Jenkinsfile setf groovy' >> ~/.vimrc
@SalahHamza
SalahHamza / install_ngrok.md
Last active April 18, 2024 13:17
How to install ngrok on linux subsystem for windows
@necojackarc
necojackarc / Set up Vim with clipboard on Ubuntu on WSL2.md
Last active December 28, 2023 02:45
Set up Vim on Ubuntu on Windows Subsystem for Linux 2 (WSL2) to share clipboard

This explains how to set up Vim on Ubuntu 18.04 on Windows Subsystem for Linux 2 (WSL2) in order to share the clipboard between Windows and Ubuntu.

Environments

  • Windows 10 Home
  • Ubuntu 18.04 on Windows Subsystem for Linux 2 (WSL2)

Steps

  1. Build Vim with the clipboard option enabled
  2. Set up VcXsrv Windows X Server

Fix magisk stock backup does not exist

# put stock boot.img into /sdcard/boot.img

# get sha1
adb shell
su
SHA1=$(cat $(magisk --path)/.magisk/config | grep SHA1 | cut -d '=' -f 2)