Skip to content

Instantly share code, notes, and snippets.

View thomas-thackery's full-sized avatar

Thomas Thackery thomas-thackery

View GitHub Profile
@andre3k1
andre3k1 / install-gnu-sed-on-mac-osx.sh
Created July 26, 2018 18:39
How to install gnu sed on Mac OS X and set it as the default
# Check which version of sed is used when you run the `sed` command
# The version that ships with Mac OS X is
# /usr/bin/sed
which sed
# Install gnu-sed using Homebrew
# The `--with-default-names` option configures `sed` to use gnu-sed
# Without that option, you'll need to type `gsed` to use gnu-sed
brew install --default-names gnu-sed
@rudolfratusinski
rudolfratusinski / parallels_tools_ubuntu_new_kernel_fix.md
Last active November 23, 2022 20:01
Parallels Tools fix for Ubuntu 18.04 and other Linux distributions with Kernel version >= 4.15

Preparation

  • In open Ubuntu 18.04 machine click Parallels Actions -> "Install Parallels Tools"

  • A "Parallels Tools" CD will popup on your Ubuntu desktop.

  • Open it by double mouse click, copy all the content to a new, empty directory on a desktop, name it for e.g. "parallels_fixed"

  • Open terminal, change directory to parallels_fixed (cd ~/Desktop/parallels_fixed)

  • Make command line installer executable (chmod +x install)

  • Change directory to "installer" (cd installer)

  • Make few other scripts executable: chmod +x installer.* *.sh prl_*

@SteveRyan-ASU
SteveRyan-ASU / redirect-from-json.php
Created January 31, 2018 17:14
Pantheon: Redirect via JSON feed in private file section
// PHP snippet included in wp-config.php (or settings.php).
// Including from that location in a separate file is OK as well.
<?php
// Remove any leading "www." from the host name.
$redirect_host = str_replace('www.', '', $_SERVER['HTTP_HOST']);
$redirect_path = strtolower(rtrim($_SERVER['REQUEST_URI']));
if (strlen($redirect_path) > 2) {
$redirect_path = rtrim($redirect_path, '/');
}
@zgordon
zgordon / wp-nav-menu-parameters.php
Last active January 7, 2024 05:15
Demo of the possible menu parameters for wp_nav_menu
<?php
$args = [
// Location pickable in Customizer
'theme_location' => 'main-menu',
// Assigns a default menu to location
'menu' => 'Main Menu',
// Main wrapper around the ul of posts
'container' => 'div',
'container_class' => 'container-class',
'container_id' => 'container-id',
@pixelbacon
pixelbacon / squarespaceBreakpoints.less
Last active January 24, 2024 09:32
Squarespace Breakpoints.
/**
Squarespace essentially doesn't really document their breakpoints.
This can be quite annoying to not have when doing custom CSS.
Most themes use essentially one breakpoint. Mobile and not mobile; anything 750 and below is considered mobile.
You can use these to write your own CSS and simply use the "Style Editor" to inject your compiled CSS in the event
you are not using "Developer Mode" in your site.
Enjoy!
@andreyvit
andreyvit / tmux.md
Created June 13, 2012 03:41
tmux cheatsheet

tmux cheat sheet

(C-x means ctrl+x, M-x means alt+x)

Prefix key

The default prefix is C-b. If you (or your muscle memory) prefer C-a, you need to add this to ~/.tmux.conf:

remap prefix to Control + a

@astroud
astroud / DigitalColor-Meter-fix.scpt
Created January 31, 2012 21:34
Lion's DigitalColor Meter defaults to displaying color values as decimals instead of hex. Loading DigitalColor Meter via this AppleScript remedies that.
-- Mountain Lion (10.8) fixed this oversight. The DigitalColor Meter now remembers it's settings on exit.
-- DigitalColor Meter defaults to displaying color values in decimal and will not remember hexidecimal preferences on close. So this script launches the app and tells it to display values in hex. It is meant to be launched via QuickSilver or a launcher.
-- Checks to see if System Preferences > Universal Access > Enable access for assistive devices is checked
-- This option is required for "System Events" to use the keystroke and key code commands.
-- If it is not checked, your password is required to make the change
tell application "System Events" to if not UI elements enabled then
set UI elements enabled to true