Skip to content

Instantly share code, notes, and snippets.

@evanwill
evanwill / gitBash_windows.md
Last active April 17, 2024 08:53
how to add more utilities to git bash for windows, wget, make

How to add more to Git Bash on Windows

Git for Windows comes bundled with the "Git Bash" terminal which is incredibly handy for unix-like commands on a windows machine. It is missing a few standard linux utilities, but it is easy to add ones that have a windows binary available.

The basic idea is that C:\Program Files\Git\mingw64\ is your / directory according to Git Bash (note: depending on how you installed it, the directory might be different. from the start menu, right click on the Git Bash icon and open file location. It might be something like C:\Users\name\AppData\Local\Programs\Git, the mingw64 in this directory is your root. Find it by using pwd -W). If you go to that directory, you will find the typical linux root folder structure (bin, etc, lib and so on).

If you are missing a utility, such as wget, track down a binary for windows and copy the files to the corresponding directories. Sometimes the windows binary have funny prefixes, so

@jasewarner
jasewarner / gitignore-for-wordpress-theme
Last active March 7, 2024 04:41
WordPress project .gitignore
# ignore everything in the root except the "wp-content" directory.
/*
!wp-content/
# ignore everything in the "wp-content" directory, except:
# mu-plugins, plugins, and themes directories
wp-content/*
!wp-content/mu-plugins/
!wp-content/plugins/
!wp-content/themes/
@joyrexus
joyrexus / README.md
Last active February 24, 2024 15:16
collapsible markdown

collapsible markdown?

CLICK ME

yes, even hidden code blocks!

print("hello world!")
@luetkemj
luetkemj / wp-query-ref.php
Last active February 6, 2024 14:25
WP: Query $args
// This gist is now maintained on github at https://github.com/luetkemj/wp-query-ref
<?php
/**
* WordPress Query Comprehensive Reference
* Compiled by luetkemj - luetkemj.github.io
*
* CODEX: http://codex.wordpress.org/Class_Reference/WP_Query#Parameters
* Source: https://core.trac.wordpress.org/browser/tags/4.9.4/src/wp-includes/query.php
*/
@NaveenKharwar
NaveenKharwar / docker-compose.yml
Last active November 10, 2022 15:56
Docker Compose File:- WordPress + PhpMyAdmin + WP-CLI
version: '3'
services:
# Database
db:
image: mysql:5.7
volumes:
- db_data:/var/lib/mysql
restart: always
environment:
@bradt
bradt / wp-image-crop-position.php
Created November 29, 2011 20:56
WordPress: Set an image's crop position and rotates images based on EXIF information if necessary
<?php
/* Example Usage:
* bt_add_image_size( 'product-screenshot', 300, 300, array( 'left', 'top' ) );
* bt_add_image_size( 'product-feature', 460, 345, array( 'center', 'top' ) );
*/
add_filter( 'intermediate_image_sizes_advanced', 'bt_intermediate_image_sizes_advanced' );
add_filter( 'wp_generate_attachment_metadata', 'bt_generate_attachment_metadata', 10, 2 );
/**
@jancbeck
jancbeck / wp-role-bodyclass.php
Last active January 15, 2022 19:34
WordPress: Add user role class to body tag
<?php
// Add role class to body
function add_role_to_body($classes) {
foreach (wp_get_current_user()->roles as $user_role) {
$classes[] = 'role-'. $user_role;
}
return $classes;
});
add_filter('body_class','add_role_to_body');
@justincarroll
justincarroll / bootstrap-masonry-template.htm
Last active August 15, 2020 16:48
This is my template for using Masonry 3 with Bootstrap 3. For those of you who follow this gist a lot has changed since Bootstrap 2.
<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>Bootstrap Masonry Template</title>
<link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css">
<link rel="stylesheet" href="style.css">
<link rel="stylesheet" href="http://fonts.googleapis.com/css?family=PT+Sans+Caption:400,700">