This example is part of this article.
This is an example for an HLS delivery with basic security. Nginx compiled with nginx-rtmp-module & secure-link is used as media server. Features:
- Domain filtering
- Referrer filtering
- Embed buster
#!/bin/bash | |
# 🚀 Discover More: Testing Your Firewall in 60 Seconds: A Lightweight WAF Testing Script That Anyone Can Use | |
# Learn how this script works and the best practices for WAF testing. | |
# Read the full article here: | |
# 👉 https://medium.com/@kochuraa/testing-your-firewall-in-60-seconds-a-lightweight-waf-testing-script-that-anyone-can-use-a7a725fefcb7 | |
# Safe WAF Tester Script | |
# Usage: ./waf-smoke-test.sh <URL> [-o output.md] [-H "Header: Value"] | |
# Examples: |
/** | |
* Step 1: Copy the code here below | |
* Step 2: Add it to your functions.php file. Better option, install and add the code using Code snippets plugin | |
*/ | |
add_action( 'woocommerce_sale_flash', 'sale_badge_percentage', 25 ); | |
function sale_badge_percentage() { | |
global $product; | |
if ( ! $product->is_on_sale() ) return; | |
if ( $product->is_type( 'simple' ) ) { | |
$max_percentage = ( ( $product->get_regular_price() - $product->get_sale_price() ) / $product->get_regular_price() ) * 100; |
This example is part of this article.
This is an example for an HLS delivery with basic security. Nginx compiled with nginx-rtmp-module & secure-link is used as media server. Features:
class CustomIcons { | |
CustomIcons._(); | |
static const _kFontFam = 'CustomIcons'; | |
static const IconData home = const IconData(0xe801, fontFamily: _kFontFam); | |
static const IconData medicine = | |
const IconData(0xe800, fontFamily: _kFontFam); | |
class AppState { | |
final IndexState indexState; | |
final OfferState offerState; | |
final NotificationState notificationState; | |
final OrderState orderState; | |
final AddressState addressState; | |
final NewsState newsState; | |
final AuthState auhtState; | |
final ProductState productState; | |
final QuestionState questionState; |
import 'package:redux_remote_devtools/redux_remote_devtools.dart'; | |
Future<Store<AppState>> createStore() async { | |
// make sure to replace '192.168.1.5' your ip | |
var remoteDevtools = RemoteDevToolsMiddleware('192.168.1.5:8000'); | |
var store = Store<AppState>( | |
appReducer, | |
initialState: AppState.initial(), | |
middleware: [] |
final notificationReducer = combineReducers<NotificationState>([ | |
TypedReducer<NotificationState, SyncNotificationsAction>(_syncNotifications), | |
]); | |
NotificationState _syncNotifications( | |
NotificationState state, SyncNotificationsAction action) { | |
for (var notification in action.notifications) { | |
state.notifications.update(notification.id.toString(), (v) => notification, | |
ifAbsent: () => notification); | |
} |
List<Middleware<AppState>> createNotificationMiddleware([ | |
NotificationRepository _repository = const NotificationRepository(), | |
]) { | |
final getNotifications = _createGetNotifications(_repository); | |
return [ | |
TypedMiddleware<AppState, GetNotificationsAction>(getNotifications), | |
]; | |
} |
import 'dart:async'; | |
import 'package:flutter/cupertino.dart'; | |
import 'package:flutter/material.dart'; | |
import 'package:saidlty/data/model/notification_data.dart' as NotificationModel; | |
import 'package:flutter_redux/flutter_redux.dart'; | |
import 'package:saidlty/redux/app/app_state.dart'; | |
import 'package:saidlty/features/notifications/notifications_view_model.dart'; | |
import 'package:saidlty/redux/action_report.dart'; | |
class NotificationsView extends StatelessWidget { |
mport 'package:redux/redux.dart'; | |
import 'package:saidlty/data/model/notification_data.dart'; | |
import 'package:saidlty/redux/action_report.dart'; | |
import 'package:saidlty/redux/app/app_state.dart'; | |
import 'package:saidlty/redux/notification/notification_actions.dart'; | |
class NotificationsViewModel { | |
final Notification notification; | |
final List<Notification> notifications; | |
final Function(bool) getNotifications; |