Skip to content

Instantly share code, notes, and snippets.

View pixelstorm's full-sized avatar

pixelstorm pixelstorm

View GitHub Profile
@pixelstorm
pixelstorm / docker-compose.yml
Created March 30, 2018 04:50 — forked from davidmanson/docker-compose.yml
a simple docker-compose file with a WordPress + wp-cli container, with his db and phpmyadmin
version: "2"
services:
# Maria db service
mysql:
image: mariadb
ports:
- "8081:3306"
environment:
MYSQL_ROOT_PASSWORD: rootpassword
@pixelstorm
pixelstorm / HTML5 Barebones Starter Template
Last active September 6, 2018 23:08 — forked from doz-snippets/gist:3807001
HTML: HTML5 Barebones Starter Template
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title></title>
</head>
<body>
${1}
</body>
@pixelstorm
pixelstorm / sql commands
Created June 16, 2018 11:01 — forked from cmthakur/sql commands
sql commands
#restore .sql file to the database
mysql target-db-name < sql-file-name.sql -uuser -p
# [mysql dir]/bin/mysql -h hostname -u root -p
Create a database on the sql server.
mysql> create database [databasename];
List all databases on the sql server.
mysql> show databases;
@pixelstorm
pixelstorm / ubuntu_agnoster_install.md
Last active October 15, 2018 00:16 — forked from renshuki/ubuntu_agnoster_install.md
Ubuntu 16.04 + Terminator + Oh My ZSH with Agnoster Theme
Install Terminator (shell)
sudo add-apt-repository ppa:gnome-terminator
sudo apt-get update
sudo apt-get install terminator
Terminator should be setup as default now. Restart your terminal (shortcut: "Ctrl+Alt+T").
Install ZSH
sudo apt-get install zsh
Restart your terminal. Choose option 2 for Z Shell configuration.
/*
Based on:
1. http://stephen.io/mediaqueries
2. https://css-tricks.com/snippets/css/media-queries-for-standard-devices/
*/
/* iPhone 6 in portrait & landscape */
@media only screen
and (min-device-width : 375px)
and (max-device-width : 667px) {
@pixelstorm
pixelstorm / file permissions wordpress
Last active July 31, 2019 02:21 — forked from h4n2k/gist:c6f6bc88f8e21388c9f8
file permissions wordpress
##list all files and folders in current direcory with file permissions and ownerships
ls -l
## change permissions of a single file or folder
Type chmod 755 foldername, and then press Return
It will recursively change all directory permission to 755,
and all file permissions to 644:
@pixelstorm
pixelstorm / ghostscript-pdf-cheatsheet.md
Last active March 10, 2022 22:50 — forked from brenopolanski/merge-pdf-ghostscript.md
Ghostscript pdf cheatsheet

A simple Ghostscript command to merge two PDFs in a single file is shown below: gs -dNOPAUSE -sDEVICE=pdfwrite -sOUTPUTFILE=combine.pdf -dBATCH 1.pdf 2.pdf

//combile all the files gs -dNOPAUSE -sDEVICE=pdfwrite -sOUTPUTFILE=ANDHealth_website_wireframes.pdf -dBATCH homepage.pdf programs_overview.pdf plus.pdf bootcamp.pdf bright_future.pdf investor.pdf alumni.pdf partners.pdf events_archive_custom_post_type.pdf events_single.pdf News_archive.pdf news_single.pdf Rescources_custom_post_type.pdf about.pdf

//convert to v1.4 printer resolution pdf ghostscript -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dPDFSETTINGS=/printer -dNOPAUSE -dQUIET -dBATCH -sOutputFile=output.pdf input.pdf

@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' ),
@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 / 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!"