Skip to content

Instantly share code, notes, and snippets.

View pixelstorm's full-sized avatar

pixelstorm pixelstorm

View GitHub Profile
@pixelstorm
pixelstorm / docker_wordpress.md
Created August 13, 2019 11:08 — forked from bradtraversy/docker_wordpress.md
Docker Compose FIle For Wordpress, MySQL & phpmyadmin

Wordpress & Docker

This file will setup Wordpress, MySQL & PHPMyAdmin with a single command. Add the code below to a file called "docker-compose.yaml" and run the command

$ docker-compose up -d

# To Tear Down
$ docker-compose down --volumes
// # PugJs Cheat Sheet
// ## Syntax
doctype html
html
head
meta(name="Pugcupid", content="Wiggle with love")
body
main#page

BEM

Know your element (__) from your modifier (--). Both blocks and elements can have modifiers. (.b--m, .b__e--m).

In react lingo, BEM's "B" (for "Block") is a component.

Elements can nest deep in html, but the selector doesn't represent this deep nesting. (no .a__b__c, instead just .a__c - which can be in .a__b).

The idea The idea with BEM is to keep a flat hierarchy (don't nest selectors) with simple selectors - only one class per selector, and no IDs or element tags. By not nesting we have a low and consistent specificity of all html elements, which makes it possible to have modifications of styles without using !important.

@pixelstorm
pixelstorm / wp query.php
Created March 30, 2019 06:21 — forked from AaronRutley/wp query.php
wp query
<?php
/**
* WordPress Query Comprehensive Reference
* Compiled by luetkemj - luetkemj.com
*
* CODEX: http://codex.wordpress.org/Class_Reference/WP_Query
* Source: http://core.trac.wordpress.org/browser/tags/3.3.1/wp-includes/query.php
*/
$args = array(
@pixelstorm
pixelstorm / Linux CLI Commands.md
Last active April 14, 2019 06:25 — forked from molcay/Linux CLI Commands.md
Linux Commands
  • cat: concatenate files and print on the standard output
    • cat > a.txt: start a file creation
    • cat a.txt: show file content
    • cat a.txt b.txt: show files content respectively
    • cat a.txt b.txt > c.txt: create a file which contains a.txt and b.txt
  • chmod: change file mode bits
    • chmod +x a.txt: All users and groups have the execute permission
    • chmod $u$g$o a.txt: Give specific user permission
      • $u -> current user permission number
      • $g -> current user's group permission number
@pixelstorm
pixelstorm / BashShellScripting.md
Created February 4, 2019 23:25 — forked from abanoubha/BashShellScripting.md
Bash Shell Scripting Cheatsheet

Shell Scripting Crash Course - Cheatsheet for beginners

This is a bash shell scripting which can be found on Unix, Linux and Mac. You can install bash on the Linux subsystem on Windows too.

the first line is #! /bin/bash because the bash program is in /bin/bash, you can know the path where the bash is by this command which bash

print data or text on the screen

You can useecho Hello, World!or echo "Hello, world!"

@pixelstorm
pixelstorm / flexbox.md
Last active June 27, 2019 05:07 — forked from spoike/flexbox.md
Flexbox CSS Cheatsheet

fiddle for margins and paddings on the parent and child elements

http://jsfiddle.net/7XD8s/ padding:5px; /* this on the parent / margin:5px; / and that on the child, will result in a 10px gap */

Flexbox Cheatsheet

Flex Container

@pixelstorm
pixelstorm / register_custom_post_type
Created January 23, 2019 05:37 — forked from AnkanSoul/register_custom_post_type
Register Custom Post Type
// Register Custom Post Type
function slider() {
$labels = array(
'name' => _x( 'Post Types', 'Post Type General Name', 'Post Types' ),
'singular_name' => _x( 'Post Type', 'Post Type Singular Name', 'Post Types' ),
'menu_name' => __( 'Post Types', 'Post Types' ),
'name_admin_bar' => __( 'Post Type', 'Post Types' ),
'archives' => __( 'Item Archives', 'Post Types' ),
'parent_item_colon' => __( 'Parent Item:', 'Post Types' ),
'all_items' => __( 'All Items', 'Post Types' ),