Skip to content

Instantly share code, notes, and snippets.

View Mao8a's full-sized avatar

Mauricio Ochoa Mao8a

View GitHub Profile
@Mao8a
Mao8a / initial-function.js
Created February 9, 2023 21:32
JS: JavaScript Empty Function Init
/**
* @description Contact Us Component
* @const elements {Object} List of elements
* @const element {Object} DOM element
*/
(function () {
/**
* @description Main function
*/
@Mao8a
Mao8a / media-query-js-css.html
Created October 21, 2022 17:55
Use css media queries as JavaScrip variables based on a DOM element
<script>
/**
* @description Encapsule all variables and funtions
* @const mediaQueryHTML {Object} New DOM element with css heigth based on css break points
*/
(function () {
const mediaQueryHTML = document.createElement('div');
const breakPoints = {
0: 1, //xxs
// Brand Colors
$brand-primary: #50b5a7;
$brand-secondary: #e4e7e2;
$brand-third: #004e49;
// Gray Colors
$white: #ffffff;
$black: #000000;
$gray-1: #f3f3f3;
$gray-2: #e6e6e6;
@Mao8a
Mao8a / componentInit.js
Last active August 25, 2021 19:09
JS: Component Init
const componentName = {
myFunction: function() {
// Contents Go Here
},
bindAction: function() {
this.myFunction();
},
init: function() {
@Mao8a
Mao8a / javascript-functions.js
Last active May 1, 2020 06:27
JS: JavaScript Functions
// Immediately-Invoked Function Expression, or IIFE
(function () {
// your code...
})()
//Ready jQuery
$(function () {
// Code after jQuery is ready...
})
@Mao8a
Mao8a / CONSOLE:Usefull-Commands.md
Last active May 1, 2020 05:34
Usefull Commands for browser console

Console

Show Bootstrap version

$.fn.tooltip.Constructor.VERSION

Show jQuery version

@Mao8a
Mao8a / ffmpg.md
Last active December 5, 2022 18:34
VIDEO: FFMPG command line add subtitles

Convert video

ffmpeg -i /path/to/original/video.mp4 -vf subtitles=/path/to/subtitles.ass /path/to/video.mp4

Download streem

ffmpeg -protocol_whitelist file,http,https,tcp,tls,crypto -i "https://embedwistia-a.akamaihd.net/deliveries/bb7d4b29e88178fdd5c6839aa15adadbcb904218.m3u8" -c copy video.mp4

Convert str to ass subtitles

@Mao8a
Mao8a / WP: xmlrpc.php deny request.md
Last active May 1, 2020 04:50
WP: xmlrpc.php deny request
location = /xmlrpc.php {
	deny all;
	access_log off;
	log_not_found off;
}
@Mao8a
Mao8a / mysql--create-user-and-grant-privileges.md
Created July 18, 2015 02:04
MYSQL: Create User & Grant privileges

Create user and grant privileges

CREATE USER '[username]'@'%' IDENTIFIED BY '[password]';
GRANT ALL ON [database].* TO '[username]'@'%';
FLUSH PRIVILEGES;
@Mao8a
Mao8a / nginx--http-autentification.md
Last active August 29, 2015 14:25
NGINX: HTTP Authentication HTTP Authentication

HTTP Authentication

Instal apache utils and create.htpasswd file:

sudo apt-get install apache2-utils
sudo htpasswd -c /etc/nginx/.htpasswd [exampleuser]

Add this two lines inside location /

auth_basic "Restricted";