Skip to content

Instantly share code, notes, and snippets.

View mokoshalb's full-sized avatar
🏠
Available for freelance job

Okoya Usman mokoshalb

🏠
Available for freelance job
  • NodeTent - Web Development & IT Services Company
  • Lagos, Nigeria
View GitHub Profile
@mokoshalb
mokoshalb / nginx.conf
Created January 12, 2023 11:57 — forked from spiermar/nginx.conf
Nginx RMTP to HLS and DASH
#user nobody;
worker_processes 1;
#error_log logs/error.log;
#error_log logs/error.log notice;
#error_log logs/error.log info;
pid /var/run/nginx.pid;
events {
Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Ubuntu Chromium/37.0.2062.94 Chrome/37.0.2062.94 Safari/537.36
Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.85 Safari/537.36
Mozilla/5.0 (Windows NT 6.1; WOW64; Trident/7.0; rv:11.0) like Gecko
Mozilla/5.0 (Windows NT 6.1; WOW64; rv:40.0) Gecko/20100101 Firefox/40.0
Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_5) AppleWebKit/600.8.9 (KHTML, like Gecko) Version/8.0.8 Safari/600.8.9
Mozilla/5.0 (iPad; CPU OS 8_4_1 like Mac OS X) AppleWebKit/600.1.4 (KHTML, like Gecko) Version/8.0 Mobile/12H321 Safari/600.1.4
Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.85 Safari/537.36
Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/45.0.2454.85 Safari/537.36
Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/42.0.2311.135 Safari/537.36 Edge/12.10240
Mozilla/5.0 (Windows NT 6.3; WOW64; rv:40.0)
@mokoshalb
mokoshalb / info.php
Created February 20, 2020 13:29 — forked from abhimanyu003/info.php
Server Status Check.
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Server Check</title>
<link rel="stylesheet" href="//maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap.min.css">
</head>
<body>
<div class="container">
<h1>Server Check</h1>
@mokoshalb
mokoshalb / EachDirectoryPath.md
Created September 18, 2019 22:05 — forked from granoeste/EachDirectoryPath.md
[Android] How to get the each directory path.

System directories

Method Result
Environment.getDataDirectory() /data
Environment.getDownloadCacheDirectory() /cache
Environment.getRootDirectory() /system

External storage directories

@mokoshalb
mokoshalb / Office_kms
Created July 4, 2019 05:36 — forked from CHEF-KOCH/KMS_office.cmd
KMS server Windows
cd\Program Files\Microsoft Office\Office16
cd\Program Files (x86)\Microsoft Office\Office16
cscript OSPP.VBS /sethst:kms.digiboy.ir
cscript OSPP.VBS /actcscript OSPP.VBS /dstatus
slmgr.vbs /ckms
// WARNING: jquery required!
// jquery cdn: https://ajax.googleapis.com/ajax/libs/jquery/2.2.2/jquery.min.js
function detectAdblock(selector) {
return ($($(selector)[0]).css('display') == 'none');
}
function preventAdblockStyles(selector) {
$(selector).attr('style', 'display: block!important;visibility: visible!important;text-decoration: none!important;');
}
@mokoshalb
mokoshalb / .htaccess
Created August 9, 2018 12:48 — forked from voku/gist:d958041e7b1c19356e721de1eda1e6f8
.htaccess with many options + description
# Apache Server Configs v2.14 | MIT License
# https://github.com/h5bp/server-configs-apache
# (!) Using `.htaccess` files slows down Apache, therefore, if you have
# access to the main server configuration file (which is usually called
# `httpd.conf`), you should add this logic there.
#
# https://httpd.apache.org/docs/current/howto/htaccess.html.
# ----------------------------------------------------------------------
@mokoshalb
mokoshalb / php-regex-meta-description.php
Created January 5, 2018 10:08
How to PHP regex match an HTML document's meta description
<?php
function parseDescription($html) {
// Get the 'content' attribute value in a <meta name="description" ... />
$matches = array();
// Search for <meta name="description" content="Buy my stuff" />
preg_match('/<meta.*?name=("|\')description("|\').*?content=("|\')(.*?)("|\')/i', $html, $matches);
if (count($matches) > 4) {
return trim($matches[4]);
}
@mokoshalb
mokoshalb / youtube_id_regex.php
Created January 5, 2018 09:49 — forked from ghalusa/youtube_id_regex.php
Extract the YouTube Video ID from a URL in PHP
<?php
// Here is a sample of the URLs this regex matches: (there can be more content after the given URL that will be ignored)
// http://youtu.be/dQw4w9WgXcQ
// http://www.youtube.com/embed/dQw4w9WgXcQ
// http://www.youtube.com/watch?v=dQw4w9WgXcQ
// http://www.youtube.com/?v=dQw4w9WgXcQ
// http://www.youtube.com/v/dQw4w9WgXcQ
// http://www.youtube.com/e/dQw4w9WgXcQ
// http://www.youtube.com/user/username#p/u/11/dQw4w9WgXcQ
@mokoshalb
mokoshalb / php-regex-page-title.php
Created December 14, 2017 08:02
How to PHP regex match an HTML document's title
<?php
function parseTitle($html) {
// Get the text in a <title>
$matches = array();
preg_match("/<title>(.*)<\/title>/is", $html, $matches);
if (count($matches) > 1) {
return trim($matches[1]);
} else {
return null;
}