Skip to content

Instantly share code, notes, and snippets.

@nguyensinhtu
nguyensinhtu / fix_notion_app_linux_render.js
Created July 8, 2024 15:03
fix_notion_app_linux_render.js
(function __polyfill_2() {
function getClientHints(navigator) {
let { userAgent } = navigator;
let mobile, platform = '', platformVersion = '', architecture = '', bitness = '', model = '', uaFullVersion = '', fullVersionList = [];
let platformInfo = userAgent;
let found = false;
let versionInfo = userAgent.replace(/\(([^)]+)\)?/g, ($0, $1) => {
if (!found) {
platformInfo = $1;
package abc;
import java.util.Arrays;
/**
* @author tu.nguyen12
*/
public class MinimumCost {
private int maxCost = 1000000009;
package abc;
import java.util.HashSet;
import java.util.Set;
/**
* @author tu.nguyen12
*/
public class EfficientTeam {
# minify json to insert into mysql
cat payload.json | sed -e "s/'/''/g" | jq -R -s '.' > minify_json.json
# Usage: python proto-to-druid-ingestion.py path_to_generated_proto entity_name
from google.protobuf.descriptor import FieldDescriptor, Descriptor
import sys
import json
from typing import Any, Dict, List
import yaml
import importlib
import logging

Problem

I have two Github accounts: oanhnn (personal) and superman (for work). I want to use both accounts on same computer (without typing password everytime, when doing git push or pull).

Solution

Use ssh keys and define host aliases in ssh config file (each alias for an account).

How to?

  1. Generate ssh key pairs for accounts and add them to GitHub accounts.
buildscript {
ext {
grpcVersion = "1.39.0"
protobufVersion = "3.17.3"
protoGenValidateVersion = "0.4.1"
}
}
plugins {
id "com.google.protobuf" version "0.8.16"

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

# find ssh host by name
# your ssh's config will be
# Host your_host
# Hostname your_ip
# User your_username
_find_host() {
local your_host=$1
host="$( awk -v your_host=$your_host '
# some my alias
alias gb='git branch'
alias gd='git diff'
alias gp='git push'
alias gf='git fetch'
alias gs='git status'
alias ...="cd ../.."
alias ....="cd ../../.."
alias cssh="cd ~/.ssh"