Skip to content

Instantly share code, notes, and snippets.

@necojackarc
necojackarc / .eslintrc.js
Last active December 23, 2020 19:34
My ESLint configuration
module.exports = {
parserOptions: {
ecmaVersion: 2020,
},
env: {
es6: true,
},
root: true,
extends: 'eslint:recommended',
rules: {

Following the official guide, you'll bump into the following error:

$ sudo zypper ref
Repository 'Google-Chrome' is up to date.
Retrieving repository 'Yarn' metadata --------------------------------------------------------------------------------------------------------------------------------------------------------------------------[\]
Warning: File 'repomd.xml' from repository 'Yarn' is signed with an unknown key '9CBBB5586963F07F'.

    Note: Signing data enables the recipient to verify that no modifications occurred after the data
    were signed. Accepting data with no, wrong or unknown signature can lead to a corrupted system
function initialize() {
if (!is_ios()) return;
let document_click_on_ios;
document.addEventListener('touchstart', () => {
document_click_on_ios = true;
});
document.addEventListener('touchmove', () => {

To use AWS Lambda (Serverless) with RDS in production, you should

  • warm up functions
  • preserve DRS connections

configure_handlers.js configures Serverless handler functions to achieve them.

Usage

Describes what I always do when installed PostgreSQL.

  1. Create new user who has the same power as postgres
  2. Change login method when connecting it via host names

1. Create new user who has the same power as postgres

Connect postgres DB as postgres user:

This instruction will store the source in /usr/local/src following the linux convention.

$ sudo apt update
$ sudo apt install libssl-dev autoconf automake libtool python-setuptools python-dev
$ cd /usr/local/src
$ sudo git clone https://github.com/facebook/watchman.git
$ cd watchman
$ sudo git checkout v4.9.0  # the latest stable release
$ sudo ./autogen.sh
$ yarn workspaces info --json | jq -rc '.data | fromjson | keys | .[]' | sed 's/^/yarn workspace /g' | sed 's/$/ test/g' | sh
@necojackarc
necojackarc / Mac Settings.md
Last active February 20, 2024 10:46
Mac Settings

General

  • Show the battery percentage (System Settings > Control Centre > Battery)
  • Show all filename extensions on Finder (Finder > Settings > Advanced)
  • Show Path Bar on Finder (Finder > View)
  • Install KeePassXC to manage credentials
  • Install Google Drive to sync important files such as KeePass file
  • Install Google Chrome
  • Install AlDente to limit maximum charging percentage
  • Show App Switcher (cmd+TAB) on all displays
  • defaults write com.apple.Dock appswitcher-all-displays -bool true
@necojackarc
necojackarc / JavaScript DateOnly and TimeOnly classes.md
Last active July 27, 2018 09:45
JavaScript DateOnly and TimeOnly classes
'use strict';

const moment = require('moment');

class DateOnly {
  /**
   * @param {moment|Date|string} input an object or a string moment.js can parse
   */
  constructor(input) {
@necojackarc
necojackarc / format_url.js
Last active September 25, 2019 16:29
Format URL function that can be partially applied made for fun!
'use strict';
const qs = require('qs');
function format_url(base) {
const remove_trailing_slash = (element) => {
return element.endsWith('/') ? element.slice(1, -1) : element;
};
const remove_leading_slash = (element) => {