Skip to content

Instantly share code, notes, and snippets.

function auto_post_slug( $slug, $post_ID, $post_status, $post_type ) {
if ( preg_match( '/(%[0-9a-f]{2})+/', $slug ) ) {
$slug = utf8_uri_encode( $post_type ) . '-' . $post_ID;
}
return $slug;
}
add_filter( 'wp_unique_post_slug', 'auto_post_slug', 10, 4 );
#!/bin/bash
# +----------------------------------------------------------------------+
# | |
# | Mount the root file system / with the option noatime |
# | |
# | By Philipp Klaus <http://blog.philippklaus.de> |
# | Tip found on <http://blogs.nullvision.com/?p=275> |
# | |
# +----------------------------------------------------------------------+
@chrysalysm
chrysalysm / MoveTemporaryFoldersToRamdisk_MacOSX.sh
Last active May 12, 2018 18:49 — forked from pklaus/AlwaysMountRootFSWithNoatime_MacOSX.sh
Shell script to create RamDisk and move temp folders to RamDisk. Increased original RamFS values from 256/64 to 512/128. Moved startup item to /Library/StartupItems instead of /System/Library/StartupItems. https://developer.apple.com/library/mac/documentation/MacOSX/Conceptual/BPSystemStartup/Chapters/StartupItems.html
#!/bin/bash
# +----------------------------------------------------------------------+
# | |
# | Set up Mac OS X to store temporary files in RAM rather than on disk.|
# | |
# | By Philipp Klaus <http://blog.philippklaus.de> |
# | |
# | Originally by Ricardo Gameiro <http://blogs.nullvision.com/?p=357> |
# | Changes by Daniel Jenkins |
@bgotink
bgotink / mount_tmpfs.sh
Created August 6, 2012 19:16 — forked from koshigoe/mount-ram.sh
Like tmpfs in Mac OS X. This code is public domain.
#!/bin/sh
# This program has two feature.
#
# 1. Create a disk image on RAM.
# 2. Mount that disk image.
#
# Usage:
# $0 <dir> <size>
#
#!/bin/sh
# This program has two feature.
#
# 1. Create a disk image on RAM.
# 2. Mount that disk image.
#
# Usage:
# $0 <dir> <size> <name>
#
@franciscocpg
franciscocpg / install.sh
Last active May 12, 2018 20:11 — forked from koshigoe/mount-ram.sh
Like tmpfs in Mac OSX
#!/bin/bash
set -e
curl https://gist.githubusercontent.com/franciscocpg/e929676f28c321692237/raw/mount-ram.sh -o /usr/local/bin/mount-ram
chmod +x /usr/local/bin/mount-ram
curl https://gist.githubusercontent.com/franciscocpg/e929676f28c321692237/raw/umount-ram.sh -o /usr/local/bin/umount-ram
chmod +x /usr/local/bin/umount-ram
@JoySR
JoySR / EasyFindwithKM.scpt
Last active June 9, 2018 14:18
AppleScript for Search with EasyFind using Keyboard Maestro
tell application "Keyboard Maestro Engine"
--Fetch Variables from KM
--What?
set EFText to make variable with properties {name:"EasyFindText"}
set EFTextValue to value of EFText
--Where?
set EFLocation to make variable with properties {name:"EasyFindLocation"}
set EFLocationValue to value of EFLocation
--Which?
@osima
osima / autotag.jsx
Created July 12, 2010 02:39
自動的にタグをつける,InDesign
//
// 現在処理中のドキュメントのテキストフレーム(s)に tf というXMLタグを付けるスクリプト
// InDesign CS3
//
// ■事前に準備しておくXMLタグ
// page,tf,table,cell,image
// (タグ付きプリセットオプションにて セル→cellに設定しておくこと.)
//
@Hultner
Hultner / block_mackeeper.sh
Last active June 23, 2018 05:14
Block MacKeeper
#!/usr/bin/env sh
# Need super user privileges to edit hosts
SUDO=''
if (( $EUID != 0 )); then
SUDO='sudo'
fi
$SUDO cat <<EOT >> /etc/hosts