Skip to content

Instantly share code, notes, and snippets.

import React from 'react';
import throttle from 'lodash/throttle';
class WidthListener extends React.PureComponent {
width = 0;
constructor(props) {
super(props);
this.onWidthChangeThrottled = throttle(this.onWidthChange, 200);
}
package com.xinghui.notificationlistenerservicedemo;
import android.app.ActivityManager;
import android.app.Service;
import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;
import android.content.pm.PackageManager;
import android.os.IBinder;
import android.os.Process;
@kossoy
kossoy / bashrc.sh
Last active October 22, 2023 12:14
Elementary OS default .bashrc
# ~/.bashrc: executed by bash(1) for non-login shells.
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
# for examples
# We use preexec and precmd hook functions for Bash
# If you have anything that's using the Debug Trap or PROMPT_COMMAND
# change it to use preexec or precmd
# See also https://github.com/rcaloras/bash-preexec
# If not running interactively, don't do anything
case $- in