Skip to content

Instantly share code, notes, and snippets.

View lauhakari's full-sized avatar
🏠
Working from home

Mikko Lauhakari lauhakari

🏠
Working from home
View GitHub Profile
@lauhakari
lauhakari / change_wordpress_post_label.php
Last active October 11, 2015 13:27
Change names/labels of Wordpress "Posts"
<?php
/*
* Add this code to your functions.php file (or in a file that is included in it).
* Change the TEXTDOMAIN to match one in your theme, or remove argument all together.
*
* In example code below Post(s) is changed to New(s).
*/
/** Changes the menu labels for "Posts" **/
@lauhakari
lauhakari / wp-pagination-url.php
Last active December 28, 2021 01:07
Change the pagination url in Wordpress (3+) You can put in a plugin file or your functions.php.
<?php
add_action( 'init', 'my_custom_page_word' );
function my_custom_page_word() {
global $wp_rewrite; // Get the global wordpress rewrite-rules/settings
// Change the base pagination property which sets the wordpress pagination slug.
$wp_rewrite->pagination_base = "new-slug"; //where new-slug is the slug you want to use ;)
}
@lauhakari
lauhakari / wp-plugin-composer.json
Created September 5, 2015 13:53
Add Wordpress plugins to composer.json file, from custom Git-repo.
/** name: on the repo is what you call later down in the "require" section.
It does not necessarily need to be the repo user and repo name, but is good practice! :)
**/
{
"repositories": [
{
"type": "composer",
"url": "http://wpackagist.org"
},
@lauhakari
lauhakari / .bash_prompt
Created November 19, 2015 11:05
Some colouring for your Bash. Also adds git branch and info if you're in a git folder.
# Shell prompt based on the Solarized Dark theme.
# Screenshot: http://i.imgur.com/EkEtphC.png
# Heavily inspired by @necolas’s prompt: https://github.com/necolas/dotfiles
# iTerm → Profiles → Text → use 13pt Monaco with 1.1 vertical spacing.
if [[ $COLORTERM = gnome-* && $TERM = xterm ]] && infocmp gnome-256color >/dev/null 2>&1; then
export TERM='gnome-256color';
elif infocmp xterm-256color >/dev/null 2>&1; then
export TERM='xterm-256color';
fi;
@lauhakari
lauhakari / .gitconfig
Last active January 27, 2020 22:34
Some extra stuff to put in your .gitconfig, likes shorthand commands and aliases.
submodules[alias]
# View abbreviated SHA, description, and history graph of the latest 20 commits
l = log --pretty=oneline -n 20 --graph --abbrev-commit
# View the current working tree status using the short format
s = status -s
# Show the diff between the latest commit and the current state
d = !"git diff-index --quiet HEAD -- || clear; git --no-pager diff --patch-with-stat"
@lauhakari
lauhakari / Contract Killer 3.md
Created April 4, 2016 09:39
The latest version of my ‘killer contract’ for web designers and developers

Contract Killer

The popular open-source contract for web professionals by Stuff & Nonsense

  • Originally published: 23rd December 2008
  • Revised date: March 15th 2016
  • Original post

@lauhakari
lauhakari / vertically-center-modal.css
Last active February 16, 2022 02:53
Vertically centered modal
.modal {
text-align: center;
padding: 0!important;
}
.modal:before {
content: '';
display: inline-block;
height: 100%;
vertical-align: middle;

Keybase proof

I hereby claim:

To claim this, I am signing this object:

@lauhakari
lauhakari / vhost.md
Created December 6, 2021 14:48 — forked from jentanbernardus/vhost.md
Setting Up Virtual Hosts in MAMP on Windows

1. Edit MAMP Apache configuration to include Virtual Hosts configuration

In File Explorer, go to C:\MAMP\conf\apache and open httpd.conf with your text editor.

Find this line:

# Virtual hosts
# Include conf/extra/httpd-vhosts.conf
@lauhakari
lauhakari / Three Wise Monkeys.md
Created January 2, 2022 16:42 — forked from brunogirin/Three Wise Monkeys.md
Three Wise Monkeys (NDA)

Date: [date]

Between us [company name] and you [customer name].

Summary:

In short; neither of us will share any confidential information about each-other, by any means, with anyone else.

What’s confidential information?