Skip to content

Instantly share code, notes, and snippets.

View CesarChaMal's full-sized avatar

Cesar Francisco Chavez Maldonado CesarChaMal

View GitHub Profile
<?php
/*
* Plugin Name: WP Remove Assets
* Plugin URI: https://github.com/CesarChaMal
* Version: 0.1
* Description: Filter particular scripts and style to load in posts or pages that don't need it.
* Author: Cesar Chavez
* Author URI: https://github.com/CesarChaMal
*/
<?php
/*
* Plugin Name: WP Remove Assets
* Plugin URI: https://gist.github.com/CesarChaMal/d8bc69fcbb5d0e8562a60682b3a08007
* Version: 0.1
* Description: Filter particular scripts and style to load in posts or pages that don't need it.
* Author: Cesar Chavez
* Author URI: https://github.com/CesarChaMal
*/
@CesarChaMal
CesarChaMal / quickpick
Created January 30, 2019 15:31 — forked from Dyrcona/quickpick
A bash script to batch git cherry-pick of many commits from a single source branch. It can become a new git command if you save it in your path with a name like git-quickpick. Then, you can run it like so `git quickpick foo/bar'. Very handy, that.
#!/bin/bash
# Author: Thomas Berezansky <tsbere@mvlc.org>
# Author: Jason Stephenson <jason@sigio.com>
#
# Feel free to use and to share this script in anyway you like.
# This script is intended as a shortcut for the git cherry-pick
# command when you have several commits that you want to cherry-pick
# into your local branch from another branch. It often results in a
@CesarChaMal
CesarChaMal / basic.sql
Created August 16, 2019 10:04 — forked from nesquena/basic.sql
PostgreSQL Common Utility Queries
/* How to calculate postgreSQL database size in disk ? */
SELECT pg_size_pretty(pg_database_size('thedbname'));
/* Calculate size of a table including or excluding the index */
SELECT pg_size_pretty(pg_total_relation_size('big_table'));
SELECT pg_size_pretty(pg_relation_size('big_table')); /* without index */
/* See indexes on a table with `\d tablename` */
@CesarChaMal
CesarChaMal / clean_code.md
Created October 4, 2019 13:17 — forked from wojteklu/clean_code.md
Summary of 'Clean code' by Robert C. Martin

Code is clean if it can be understood easily – by everyone on the team. Clean code can be read and enhanced by a developer other than its original author. With understandability comes readability, changeability, extensibility and maintainability.


General rules

  1. Follow standard conventions.
  2. Keep it simple stupid. Simpler is always better. Reduce complexity as much as possible.
  3. Boy scout rule. Leave the campground cleaner than you found it.
  4. Always find root cause. Always look for the root cause of a problem.

Design rules

CSS


What is CSS?

  • CSS stands for Cascading Style Sheet.
  • Styles define how to display HTML elements
  • Styles were added to HTML 4.0 to solve a problem
  • External Style Sheets can save a lot of work
  • External Style Sheets are stored in CSS files
@CesarChaMal
CesarChaMal / java-pom-template.xml
Created November 24, 2019 01:21 — forked from sparsick/java-pom-template.xml
Maven POM Template for Java Projects
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId></groupId>
<artifactId></artifactId>
<version>1.0.0-SNAPSHOT</version>

While using git-bash, you may need the zip command to zip files. Then you will get error like “command not found“. This is because git-bash is really just a cut down version of mingw. Fortunately you can manually install the command yourself, not only zip, but any command you can get from gnuwin32.

Here are the steps you can follow.

  1. Go to the following link https://sourceforge.net/projects/gnuwin32/files/

  2. Find out whatever command you are missing Here I need zip and bzip2 for zip command. Because zip command relies on bzip2.dll to run. Otherwise you will get error “error while loading shared libraries: ?: cannot open shared object file: No such file or directory”.

@CesarChaMal
CesarChaMal / 1 - sql_interview_questions.md
Created December 4, 2019 11:57 — forked from mjhea0/1 - sql_interview_questions.md
Jitbit's SQL interview questions
@CesarChaMal
CesarChaMal / JitBitSQLAnswers.sql
Created December 4, 2019 12:00 — forked from rsepassi/JitBitSQLAnswers.sql
JitBit SQL Interview Questions Answered
-- JitBit SQL Interview Questions (Posted on Hacker News)
-- http://www.jitbit.com/news/181-jitbits-sql-interview-questions/?utm_source=hackernewsletter&utm_medium=email
-- Schema:
-- employees table
-- EmployeeID
-- DepartmentID
-- BossID
-- Name
-- Salary