Skip to content

Instantly share code, notes, and snippets.

@ouija
ouija / lightslider-breakpoints-bootstrap.js
Created August 26, 2022 04:15
lightSlider breakpoints for Bootstrap
/*
These are breakpoints utilized with lightSlider (http://sachinchoolur.github.io/lightslider/) and Bootstrap framework.
Note: lightSlider doesn't seem to account for scrollbar wideth in the breakpoint value.
*/
responsive : [
{
breakpoint:1383, /* lightslider is 17px (scrollbar width) less than actual window size */
settings: {
item:5
// 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) {
@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
@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 / 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 / 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 / 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 / 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)