Skip to content

Instantly share code, notes, and snippets.

@baoanhng
baoanhng / userscript.js
Last active May 27, 2020 08:00
Persist FB volume
// ==UserScript==
// @name Facebook video volume persistence
// @namespace http://tampermonkey.net/
// @version 1.1
// @description Maintains set volume of videos on play of videos on Facebook.
// @include https://facebook.com/*
// @include https://www.facebook.com/*
// @grant GM_setValue
// @grant GM_getValue
// ==/UserScript==

Keybase proof

I hereby claim:

  • I am baoanhng on github.
  • I am embersglow (https://keybase.io/embersglow) on keybase.
  • I have a public key ASDP1qeTaOJl1dK4tjlT_D4jQHdRcxOCmKQd3CfQjIbLHAo

To claim this, I am signing this object:

Keybase proof

I hereby claim:

  • I am baona95 on github.
  • I am embersglow (https://keybase.io/embersglow) on keybase.
  • I have a public key ASAqM2ADH_WmGLrkQBFeXhDGw851yegPAdmNUaNk1xj32Qo

To claim this, I am signing this object:

@baoanhng
baoanhng / Component.js
Created January 27, 2018 14:43 — forked from smontlouis/Component.js
React Native - Fixed header/footer disappearing on scroll
import React, { PropTypes, Component } from 'react'
import {
Animated,
ScrollView,
Text,
View,
} from 'react-native'
import EStyleSheet from 'react-native-extended-stylesheet'
const styles = EStyleSheet.create({
// ==UserScript==
// @name New Userscript
// @namespace http://tampermonkey.net/
// @version 0.1
// @description try to take over the world!
// @author You
// @match https://ln.hako.re/thao-luan/*
// @grant GM_addStyle
// ==/UserScript==
public static int subStrCount(String string, String substr) {
int count = 0;
int lastIndex = 0;
while ( (lastIndex = string.indexOf(substr, lastIndex) + 1) > 0 ) {
count++;
}
return count;
}