Skip to content

Instantly share code, notes, and snippets.

View Mao8a's full-sized avatar

Mauricio Ochoa Mao8a

View GitHub Profile
@Mao8a
Mao8a / wp-issues-fixed.md
Last active March 4, 2016 15:57
WP:Issues-Fixed

Worpress Fixes

Fatal error: Allowed memory size of 268435456 bytes exhausted at...

Add this lines to wp-config.php before wp-settings

/** Increase memory limit */
define( 'WP_MEMORY_LIMIT', '1024M' );
define( 'WP_MAX_MEMORY_LIMIT', '1024M' );
@Mao8a
Mao8a / Coomon-proportions.scss
Last active August 25, 2022 17:33
SCSS: Common proportions
/*
Frequently used proportions:
Square: 1:1 -> 1 -> 100% example: 400x400px
Portrait: 4:3 -> 1.333...:1 -> 75% example: 800x600px
Divine: 5:3~ -> 1.618:1 -> 61.8% example: 1110x686px
Landscape: 16:9 -> 1.777...:1 -> 56.25% example: 1280x720px
Film A: 37:20 -> 1.85:1 -> 54.05% example: 1140x616px
Film B: 21:9 -> 2.4:1 -> 41.84% example: 1140x477px
*/
$prop-1-1: 100%;
@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";
@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 / 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 / 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 / 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 / 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 / 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() {
// Brand Colors
$brand-primary: #50b5a7;
$brand-secondary: #e4e7e2;
$brand-third: #004e49;
// Gray Colors
$white: #ffffff;
$black: #000000;
$gray-1: #f3f3f3;
$gray-2: #e6e6e6;