Skip to content

Instantly share code, notes, and snippets.

// ==UserScript==
// @name swfobject-patch
// @namespace http://saschanaz.github.io/
// @version 0.2
// @description try to take over the world!
// @author You
// @match http://*/*
// @grant none
// @run-at document-start
// ==/UserScript==
@ouija
ouija / rt5651.c
Last active July 22, 2019 13:09
kernel-4.16/sound/soc/codec/rt5651.c [Insigina Flex8 NS-P08W7100]
/*
* rt5651.c -- RT5651 ALSA SoC audio codec driver
*
* Copyright 2014 Realtek Semiconductor Corp.
* Author: Bard Liao <bardliao@realtek.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*/
@ouija
ouija / rt5651.c
Last active July 27, 2019 21:47
kernel-4.18/sound/soc/codec/rt5651.c [Insigina Flex8 NS-P08W7100]
/*
* rt5651.c -- RT5651 ALSA SoC audio codec driver
*
* Copyright 2014 Realtek Semiconductor Corp.
* Author: Bard Liao <bardliao@realtek.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
*/
@ouija
ouija / wifi.sh
Created July 29, 2019 00:08
r8723bs wifi sleep fix
#!/system/bin/sh
while true
do
# check device wakefulness state
WAKE_STATE=$(dumpsys power | grep -m1 'mWakefulness' | cut -d = -f 2)
#echo "Wakefulness: $WAKE_STATE"
if [ "$WAKE_STATE" = "Asleep" ]; then
@ouija
ouija / jack-detect.sh
Last active August 2, 2019 06:53
Headphone Jack Detection Script for bytcrrt_5651
#!/system/bin/sh
# Audio input jack detection script by @ouija
# get headset input device
DEVICE=$(getevent -Sv | grep -B 5 -m1 'bytcr-rt5651 Headset' | grep -m1 'add device' | cut -d : -f 2)
if [ ! -z "$DEVICE" ]; then
sleep 3
while true
@ouija
ouija / hdmi.sh
Last active August 2, 2019 06:59
HDMI detection audio switcher script
#!/system/bin/sh
# HDMI detection audio switcher script by @ouija
# note the following patches may be required for HDMI connect/disconnect status to work properly in some kernels
# drm/i915: Fix the HDMI hot plug disconnection failure (v2) -> https://patchwork.kernel.org/patch/10625143/
# drm/i915: delay hotplug scheduling -> https://patchwork.kernel.org/patch/10613549/
# get hdmi insert input device [disabled/not reliable]
# DEVICE=$(getevent -Sv | grep -B 5 -m1 'HDMI/DP,pcm=2' | grep -m1 'add device' | cut -d : -f 2)
@ouija
ouija / owl.carousel.js
Created November 10, 2019 23:36
owlcarousel fix for azh_extension plugin (FoodPicky Theme)
@ouija
ouija / swaggerauth.php
Last active December 9, 2019 08:04
WP API SwaggerUI with WooCommerce Consumer Key/Secret Authentication
<?php
class SwaggerAuth {
private $error = null;
// woocommerce/includes/class-wc-rest-authentication.php -> get_user_data_by_consumer_key function
private function get_user_data_by_consumer_key( $consumer_key ) {
global $wpdb;
@ouija
ouija / README.md
Created February 27, 2020 01:01 — forked from mrbar42/README.md
bash scripts to create VOD HLS stream with ffmpeg almighty (tested on Linux and OS X)

running:

bash create-vod-hls.sh beach.mkv

will produce:

    beach/
      |- playlist.m3u8
 |- 360p.m3u8
// Override Ninja Forms v3.6.1+ submissions page and make select list to redirect to post editor
function override_nf_submissions() {
if (is_admin() && !defined( 'DOING_AJAX' ) && $_GET['page'] == "nf-submissions") {
if (is_numeric($_GET['form_id'])) header("Location: edit.php?post_status=all&post_type=nf_sub&form_id=".$_GET['form_id']."&nf_form_filter&paged=1");
?>
<script>
jQuery(function($) {
$('#inspector-select-control-0').replaceWith($('#inspector-select-control-0').clone());
$('#nf-submissions-element > div > div.tablenav.top > div > div.nf_form_filter_container').remove();
$(document).on('change','#inspector-select-control-0', function(e) {