Skip to content

Instantly share code, notes, and snippets.

View niraj-khatiwada's full-sized avatar

Niraj Khatiwada niraj-khatiwada

View GitHub Profile
Dec 08 11:57:32 niraj systemd[1]: Starting livesys.service - LSB: Init script for live image....
Dec 08 11:57:32 niraj systemd[1]: Starting lm_sensors.service - Hardware Monitoring Sensors...
Dec 08 11:57:32 niraj lm_sensors-modprobe-wrapper[831]: No sensors with loadable kernel modules configured.
Dec 08 11:57:32 niraj lm_sensors-modprobe-wrapper[831]: Please, run 'sensors-detect' as root in order to search for available sensors.
Dec 08 11:57:32 niraj systemd[1]: Started low-memory-monitor.service - Low Memory Monitor.
Dec 08 11:57:32 niraj audit: BPF prog-id=67 op=LOAD
Dec 08 11:57:32 niraj audit[1]: SERVICE_START pid=1 uid=0 auid=4294967295 ses=4294967295 subj=system_u:system_r:init_t:s0 msg='unit=low-memory-monitor comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? terminal=? res=success'
Dec 08 11:57:32 niraj audit[1]: SERVICE_START pid=1 uid=0 auid=4294967295 ses=4294967295 subj=system_u:system_r:init_t:s0 msg='unit=mcelog comm="systemd" exe="/usr/lib/systemd/systemd" hostname=? addr=? term
function Favorite({
postId = null,
isLiked: _isLiked = false,
numberOfLikes: _numberOfLikes = 0,
}) {
const [isLiked, setIsLiked] = React.useState(_isLiked);
const [numberOfLikes, setNumberOfLikes] = React.useState(_numberOfLikes ?? 0);
const likeDebounceRef = React.useRef();
const lastIsLikedStateRef = React.useRef(_isLiked);
import React from 'react';
import {Keyboard} from 'react-native';
function useKeyboardHeight() {
const [keyboardHeight, setKeyboardHeight] = React.useState(0);
function onKeyboardDidShow(e) {
setKeyboardHeight(e.endCoordinates.height);
}
import React from 'react';
import {Keyboard} from 'react-native';
const useIsKeyboardVisible = () => {
const [isVisible, setIsVisible] = React.useState(false);
React.useEffect(() => {
const didShowListener = Keyboard.addListener('keyboardDidShow', () => {
setIsVisible(true);
});
@niraj-khatiwada
niraj-khatiwada / ESLint.txt
Last active April 4, 2020 15:46
eslintrc.json/niraj-khatiwada
{
"env": {
"browser": true,
"es6": true
},
"extends": [
"plugin:react/recommended",
"airbnb"
],
"globals": {
@niraj-khatiwada
niraj-khatiwada / VagrantConfig.txt
Created February 23, 2020 08:54
Global Configuration for Vagrant
# -*- mode: ruby -*-
# vi: set ft=ruby :
# All Vagrant configuration is done below. The "2" in Vagrant.configure
# configures the configuration version (we support older styles for
# backwards compatibility). Please don't change it unless you know what
# you're doing.
Vagrant.configure("2") do |config|
# The most common configuration options are documented and commented below.
# For a complete reference, please see the online documentation at