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 <[email protected]>
*
* 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 <[email protected]>
*
* 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 / 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 / sleep.sh
Last active February 15, 2023 09:15
Android-x86 "Suspend-To-Idle" (freeze power state) script
#!/system/bin/sh
# sleep fix script by @ouija - for baytrail/cherrytrail devices that only support 'Suspend-to-Idle' or freeze power state
while true
do
# get device wakefulness state
WAKE_STATE=$(dumpsys power | grep -m1 'mWakefulness' | cut -d = -f 2)
@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 / 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 / functions.php
Created August 11, 2019 22:49
WooCommerce: Remove checkout field descriptions 'slideUp and hide' animations
<?
// WooCommerce has a stupid function in the ./assets/js/frontent/woocommerce.min.js file that hides/shows the 'description' elements
// for the checkout fields both when there is an onclick event on the document body, and when any field input is clicked.
//
// The offending code for this 'feature' is the following:
// i(document.body).on("click",function(){i(".woocommerce-input-wrapper span.description:visible").prop("aria-hidden",!0).slideUp(250)}),i(".woocommerce-input-wrapper").on("click",function(e){e.stopPropagation()}),i(".woocommerce-input-wrapper :input").on("keydown",function(e){var o=i(this).parent().find("span.description");if(27===e.which&&o.length&&o.is(":visible"))return o.prop("aria-hidden",!0).slideUp(250),e.preventDefault(),!1}).on("click focus",function(){var e=i(this).parent(),o=e.find("span.description");e.addClass("currentTarget"),i(".woocommerce-input-wrapper:not(.currentTarget) span.description:visible").prop("aria-hidden",!0).slideUp(250),o.length&&o.is(":hidden")&&o.prop("aria-hidd
@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 / owl.carousel.js
Created November 10, 2019 23:36
owlcarousel fix for azh_extension plugin (FoodPicky Theme)